Skip to content

Commit 61be440

Browse files
sweetmantechclaude
andcommitted
ci: add GitHub Actions workflow to publish to npm on merge to main
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b529492 commit 61be440

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
concurrency:
8+
group: publish
9+
cancel-in-progress: false
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: pnpm/action-setup@v4
20+
with:
21+
version: 10
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
registry-url: https://registry.npmjs.org
27+
28+
- run: pnpm install --frozen-lockfile
29+
30+
- run: pnpm test
31+
32+
- run: pnpm build
33+
34+
- name: Publish to npm
35+
run: pnpm publish --no-git-checks
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
"tsup": "^8.0.0",
2424
"vitest": "^3.2.0"
2525
},
26+
"publishConfig": {
27+
"access": "public"
28+
},
2629
"pnpm": {
2730
"onlyBuiltDependencies": ["esbuild"]
2831
}

0 commit comments

Comments
 (0)