Skip to content

Commit 9a86d35

Browse files
committed
add github release workflow
1 parent a357383 commit 9a86d35

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish GitHub package
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Use Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
registry-url: 'https://registry.npmjs.org'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Set version to release tag
28+
shell: bash
29+
id: define_tag
30+
run: |
31+
PACKAGE_VERSION=$(git describe --abbrev=0 --tags | sed 's/^v//')
32+
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
33+
34+
- name: Build
35+
run: npm run build
36+
37+
- name: Publish
38+
run: npm publish
39+
env:
40+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 commit comments

Comments
 (0)