Skip to content

Commit d7bdc59

Browse files
committed
ci: add npm publish workflow triggered on version tags
1 parent 361c7fc commit d7bdc59

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/publish.yml

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

0 commit comments

Comments
 (0)