Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
# Publishes the package to the npm registry when a release is created.
# Authentication uses npm Trusted Publishing (OIDC) - no token secret required.
# The trusted publisher on npmjs.com is configured against this file name,
# so do not rename this workflow.

name: NPM Package

on:
release:
types: [created]

permissions:
contents: read
id-token: write # required for OIDC

jobs:
publish-npm:
runs-on: ubuntu-latest
Expand All @@ -16,8 +22,9 @@ jobs:
with:
node-version: 24
registry-url: https://registry.npmjs.org/
# Trusted publishing requires npm >= 11.5.1; the bundled npm may be older
- run: npm install -g npm@latest
- run: npm ci
- run: npm run build
- run: npm run build
# No NODE_AUTH_TOKEN: OIDC authenticates, and provenance is attached automatically
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}