Skip to content

Commit b03438a

Browse files
committed
chore: add release workflow
1 parent d4461cc commit b03438a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/onRelease.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup
15+
uses: ./.github/actions/setup
16+
17+
- name: Set npm tag
18+
id: set-npm-tag
19+
run: |
20+
RELEASE_TAG=${{ github.event.release.tag_name }}
21+
if [[ $RELEASE_TAG == *"rc"* || $RELEASE_TAG == *"alpha"* || $RELEASE_TAG == *"beta"* ]]; then
22+
echo "NPM_TAG=next" >> $GITHUB_OUTPUT
23+
else
24+
echo "NPM_TAG=latest" >> $GITHUB_OUTPUT
25+
fi
26+
27+
- uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c
28+
with:
29+
token: "${{ secrets.NPM_TOKEN }}"
30+
tag: ${{ steps.set-npm-tag.outputs.NPM_TAG }}

0 commit comments

Comments
 (0)