File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Package Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*.*.*'
7+ workflow_dispatch :
8+ inputs :
9+ tag :
10+ description : ' Tag to publish (e.g. v1.2.3)'
11+ required : true
12+ type : string
13+
14+ # OIDC trusted publishing — no NPM token needed
15+ permissions :
16+ contents : read
17+ id-token : write
18+
19+ jobs :
20+ npm-publish :
21+ name : Publish to npm
22+ runs-on : ubuntu-latest
23+ steps :
24+ - name : Checkout (the tag being released)
25+ uses : actions/checkout@v4
26+ with :
27+ ref : ${{ github.ref_type == 'tag' && github.ref_name || inputs.tag }}
28+
29+ - name : Set up Node.js
30+ uses : actions/setup-node@v4
31+ with :
32+ node-version : ' 22'
33+ registry-url : ' https://registry.npmjs.org'
34+
35+ - name : Upgrade npm for OIDC trusted publishing (needs npm >= 11.5.1)
36+ run : npm install -g npm@latest
37+
38+ - name : Install dependencies
39+ run : npm ci
40+
41+ - name : Publish to npm
42+ run : npm publish # authenticates via OIDC; provenance added automatically
You can’t perform that action at this time.
0 commit comments