-
Notifications
You must be signed in to change notification settings - Fork 1
27 lines (23 loc) · 942 Bytes
/
Copy pathpublish.yml
File metadata and controls
27 lines (23 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
name: Publish to npm
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '22'
cache: npm
- run: npm install -g npm@11.19.0
- run: npm ci
- name: Verify release tag matches package version
run: node -e "const version=require('./package.json').version; const expected='v'+version; if(process.env.GITHUB_REF_NAME!==expected){console.error('Expected release tag '+expected+', got '+process.env.GITHUB_REF_NAME); process.exit(1)}"
- name: Publish to npm (prepack runs verification)
run: npm publish --access public --provenance --registry https://registry.npmjs.org