File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish npm Release
2+
3+ on :
4+ workflow_dispatch : # Manual trigger for testing
5+ push :
6+ tags :
7+ - ' v*.*.*'
8+ permissions :
9+ contents : write
10+ id-token : write
11+ packages : read
12+
13+ jobs :
14+ release :
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v4
20+
21+ - name : Setup Node.js
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : ' 20.19.0'
25+ registry-url : ' https://registry.npmjs.org'
26+ cache : ' npm'
27+ always-auth : true
28+
29+ - name : Install dependencies
30+ run : npm ci
31+
32+ - name : Run tests
33+ run : npm all
34+
35+ - name : Publish to npm
36+ run : |
37+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
38+ echo "🧪 Test mode: Dry run npm publish"
39+ npm publish --dry-run --provenance
40+ else
41+ echo "🚀 Production: Publishing to npm"
42+ npm publish --provenance
43+ fi
44+ env :
45+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
46+
47+ - name : Create GitHub Release
48+ uses : softprops/action-gh-release@v2
49+ with :
50+ generate_release_notes : true
You can’t perform that action at this time.
0 commit comments