Skip to content

Commit 2ecff8c

Browse files
efoutsclaude
andcommitted
feat: add GitHub Actions workflow for automated npm publishing
- Automated publishing on version tags (v*) - Includes provenance for package authenticity - Runs tests and linting before publishing - Uses Node.js 18 and pnpm for consistency 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 4cb1941 commit 2ecff8c

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '18'
22+
registry-url: 'https://registry.npmjs.org'
23+
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v2
26+
with:
27+
version: latest
28+
29+
- name: Install dependencies
30+
run: pnpm install
31+
32+
- name: Run tests
33+
run: pnpm test
34+
35+
- name: Run linting
36+
run: pnpm run lint
37+
38+
- name: Publish to npm
39+
run: pnpm publish --provenance --access public
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)