Skip to content

Commit 184aa41

Browse files
committed
feat: release workflow
1 parent 3ca6dbb commit 184aa41

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
continue-on-error: false
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Node setup
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
cache: 'yarn'
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
registry-url: 'https://registry.npmjs.org'
24+
env:
25+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
26+
27+
- name: Config
28+
id: config
29+
run: |
30+
echo "VERSION=$(npm pkg get version)" >> $GITHUB_OUTPUT
31+
32+
- name: Install packages
33+
run: yarn install
34+
35+
- name: Build
36+
run: yarn build
37+
38+
- name: Publish
39+
run: npm publish --access public
40+
41+
- name: Publish GitHub release
42+
uses: elgohr/Github-Release-Action@v5
43+
with:
44+
title: "v${{ steps.config.outputs.VERSION }}"
45+
tag: "v${{ steps.config.outputs.VERSION }}"

0 commit comments

Comments
 (0)