Skip to content

Commit 3f06ded

Browse files
committed
ci: add npm publish workflow with trusted publishing
1 parent da3af42 commit 3f06ded

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: oven-sh/setup-bun@v2
16+
with:
17+
bun-version: latest
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
registry-url: https://registry.npmjs.org
22+
- name: Install dependencies
23+
run: bun install
24+
- name: Typecheck
25+
run: bun run typecheck
26+
- name: Build
27+
run: bun run build
28+
- name: Test
29+
run: bun test
30+
- name: Publish
31+
run: npm publish --provenance --access public
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)