Skip to content

Commit ee94fa7

Browse files
committed
feat: add GitHub Actions workflow for publishing to npm
1 parent b48d5c7 commit ee94fa7

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish
2+
permissions:
3+
contents: read
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Bun
18+
uses: oven-sh/setup-bun@v1
19+
with:
20+
bun-version: latest
21+
22+
- name: Install dependencies
23+
run: bun install
24+
25+
- name: Run tests
26+
run: bun test
27+
28+
- name: Build project
29+
run: bun run build
30+
31+
- name: Setup Node.js for NPM
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '18'
35+
registry-url: 'https://registry.npmjs.org'
36+
37+
- name: Publish to npm
38+
run: cd dist && npm publish --access public
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)