File tree Expand file tree Collapse file tree 2 files changed +57
-57
lines changed
Expand file tree Collapse file tree 2 files changed +57
-57
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Publish to npm
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ dry_run :
7+ type : boolean
8+ default : true
9+ description : ' Dry-run (test without publishing)'
10+
11+ # Required for OIDC token exchange with npm (Trusted Publishers)
12+ permissions :
13+ contents : read
14+ id-token : write
15+
16+ jobs :
17+ publish :
18+ runs-on : ubuntu-latest
19+ environment : npm-publish
20+
21+ steps :
22+ - uses : actions/checkout@v4
23+
24+ - uses : actions/setup-node@v4
25+ with :
26+ node-version : 22
27+ registry-url : ' https://registry.npmjs.org'
28+
29+ - name : Build package
30+ working-directory : src
31+ run : |
32+ npm ci
33+ npm run build
34+ npm test
35+
36+ - name : Publish to npm (dry-run)
37+ if : ${{ inputs.dry_run }}
38+ working-directory : src/dist
39+ run : |
40+ echo "🧪 DRY-RUN MODE"
41+ echo "==============="
42+ echo ""
43+ npm publish --provenance --dry-run
44+ echo ""
45+ echo "✅ Dry-run successful! Package is ready to publish."
46+ echo " To publish for real, run this workflow again with dry_run unchecked."
47+
48+ - name : Publish to npm
49+ if : ${{ !inputs.dry_run }}
50+ working-directory : src/dist
51+ run : |
52+ echo "🚀 PUBLISHING TO NPM"
53+ echo "===================="
54+ echo ""
55+ npm publish --provenance
56+ echo ""
57+ echo "✅ Published successfully with provenance!"
You can’t perform that action at this time.
0 commit comments