Skip to content

Commit 1e843b3

Browse files
committed
ci: add release workflow for npm publishing
1 parent 05ddad7 commit 1e843b3

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release (npm)
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write # needed to create a GitHub Release
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Use Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
registry-url: 'https://registry.npmjs.org'
23+
cache: npm
24+
25+
- name: Install
26+
run: npm ci
27+
28+
- name: Test
29+
run: npm test
30+
31+
- name: Build
32+
run: npm run build
33+
34+
- name: Publish to npm
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
run: npm publish --access public
38+
39+
- name: Create GitHub Release
40+
uses: softprops/action-gh-release@v1
41+
with:
42+
generate_release_notes: true

0 commit comments

Comments
 (0)