Skip to content

Commit b35f74c

Browse files
committed
add github action to deploy
1 parent 3776dbd commit b35f74c

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish to npm registry
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
env:
9+
BUN_VERSION: "latest"
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
jobs:
16+
npm-publish:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup Bun
22+
uses: oven-sh/setup-bun@v2
23+
with:
24+
bun-version: ${{ env.BUN_VERSION }}
25+
26+
- name: Install dependencies
27+
run: bun install --frozen-lockfile
28+
29+
- name: Run tests
30+
run: bun run test
31+
32+
- name: Run checks
33+
run: bun run check
34+
35+
- name: Publish to NPM
36+
run: |
37+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
38+
npm publish --access public --provenance
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)