Skip to content

ci: harden npm release builds #1

ci: harden npm release builds

ci: harden npm release builds #1

Workflow file for this run

name: Publish
on:
push:
tags:
- 'v*.*.*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false
- name: Use an npm version with trusted publishing support
run: npm install --global npm@latest
- run: npm ci
- run: node scripts/check-release-tag.mjs
env:
GITHUB_REF_NAME: ${{ github.ref_name }}
- run: npm run verify
- name: Publish with npm provenance
run: |
[ -n "$NPM_TOKEN" ] && npm config set //registry.npmjs.org/:_authToken "$NPM_TOKEN"
npm publish --access public --provenance
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}