File tree Expand file tree Collapse file tree 1 file changed +75
-0
lines changed
Expand file tree Collapse file tree 1 file changed +75
-0
lines changed 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+ description : ' Dry run (do not actually publish)'
8+ required : false
9+ default : true
10+ type : boolean
11+
12+ jobs :
13+ publish :
14+ runs-on : ubuntu-latest
15+ permissions :
16+ contents : read
17+ id-token : write # Required for OIDC provenance
18+
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v4
22+
23+ - name : Setup Node.js
24+ uses : actions/setup-node@v4
25+ with :
26+ node-version : ' 20'
27+ registry-url : ' https://registry.npmjs.org'
28+
29+ - name : Install Bun
30+ uses : oven-sh/setup-bun@v2
31+ with :
32+ bun-version : latest
33+
34+ - name : Install Dependencies
35+ run : bun install
36+
37+ - name : Build
38+ run : bun run build
39+ working-directory : packages/headwind
40+
41+ - name : Setup Zig
42+ uses : goto-bus-stop/setup-zig@v2
43+ with :
44+ version : master
45+
46+ - name : Setup pantry
47+ uses : home-lang/pantry/packages/action@main
48+ with :
49+ setup-only : ' true'
50+
51+ - name : Verify OIDC Token Available
52+ run : |
53+ if [ -n "$ACTIONS_ID_TOKEN_REQUEST_URL" ]; then
54+ echo "OIDC token endpoint available"
55+ else
56+ echo "ERROR: OIDC token endpoint not available"
57+ exit 1
58+ fi
59+
60+ - name : Verify pantry installed
61+ run : pantry --version
62+
63+ - name : Publish (Dry Run)
64+ if : ${{ inputs.dry_run == true }}
65+ run : pantry publish --dry-run --access public
66+ working-directory : packages/headwind
67+ env :
68+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
69+
70+ - name : Publish
71+ if : ${{ inputs.dry_run == false }}
72+ run : pantry publish --access public
73+ working-directory : packages/headwind
74+ env :
75+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments