Skip to content

Commit 49607af

Browse files
authored
ci: add npm publish workflow (PILOT-203) (#9)
Auto-publish on release-published. Required secret: NPM_TOKEN.
1 parent 080d93d commit 49607af

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: publish
2+
3+
# PILOT-203: npm publish workflow.
4+
#
5+
# Triggers on release published. Build the dist, then npm publish.
6+
# Optional-dependency platform packages (pilotprotocol-darwin-arm64,
7+
# etc.) are published separately by the release pipeline; this workflow
8+
# only publishes the main entry-point package.
9+
#
10+
# Required secret:
11+
# NPM_TOKEN — npmjs.org automation token with publish rights on the
12+
# pilotprotocol package.
13+
14+
on:
15+
release:
16+
types: [published]
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
publish:
24+
name: Publish to npm
25+
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
id-token: write # for npm provenance attestation
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: '22'
34+
registry-url: 'https://registry.npmjs.org'
35+
- run: npm ci
36+
- run: npm run build
37+
- run: npm publish --provenance --access public
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)