Skip to content

Publish to npm

Publish to npm #5

Workflow file for this run

name: Publish to npm
on:
release:
types: [published]
permissions:
contents: read
# Required for npm Trusted Publishing (OIDC)
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
environment: npm-publish
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org
- run: npm ci
# prepublishOnly already runs lint + build + test
- name: Publish with provenance
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}