Skip to content

Commit 4801b4c

Browse files
Merge pull request #4 from guyinwonder168/feat/npm-publish-workflow
ci: add publish to npm workflow
2 parents 533385a + 48e81bb commit 4801b4c

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
packages: write
10+
id-token: write # For provenance
11+
12+
jobs:
13+
publish-npm:
14+
name: Publish to npm
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
registry-url: 'https://registry.npmjs.org'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build TypeScript
31+
run: npm run build
32+
33+
- name: Type check
34+
run: npm run typecheck
35+
36+
- name: Lint
37+
run: npm run lint
38+
39+
- name: Run tests
40+
run: npm test
41+
42+
- name: Publish to npm
43+
run: npm publish --provenance --access public
44+
env:
45+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)