Skip to content

Commit 0b5a871

Browse files
Anil-matchaclaude
andcommitted
ci: add manual npm publish workflow with workflow_dispatch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 16ceed4 commit 0b5a871

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to npm
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to publish (e.g. 0.2.4)"
8+
required: true
9+
10+
jobs:
11+
publish-npm:
12+
name: Publish to npm
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: "20"
20+
registry-url: "https://registry.npmjs.org"
21+
22+
- name: Set version
23+
run: |
24+
jq --arg v "${{ github.event.inputs.version }}" '.version = $v' npm/package.json > /tmp/pkg.json
25+
mv /tmp/pkg.json npm/package.json
26+
echo "Publishing npm version ${{ github.event.inputs.version }}"
27+
28+
- name: Publish
29+
run: npm publish --access public
30+
working-directory: npm
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)