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
id-token: write
jobs:
check:
name: Lint, Typecheck & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.release.tag_name }}
- uses: actions/setup-node@v6
with:
node-version: "20"
cache: "npm"
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm run test:unit
publish:
name: Publish
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.release.tag_name }}
- uses: actions/setup-node@v6
with:
node-version: "20"
cache: "npm"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}