Skip to content

Commit 0cdc3cb

Browse files
committed
feat: setup auto release #4
Signed-off-by: seven <[email protected]>
1 parent 9878ad9 commit 0cdc3cb

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: package release
2+
23
on:
3-
release:
4-
branches: [master]
5-
types: [created]
4+
push:
5+
branches: [master]
66

77
jobs:
88
build:
@@ -17,7 +17,23 @@ jobs:
1717
registry-url: 'https://registry.npmjs.org'
1818
- name: Install dependencies and build 🔧
1919
run: npm ci && npm run build
20+
- name: Generate changelog
21+
uses: jaywcjlove/changelog-generator@main
22+
id: changelog
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Build Release
26+
uses: jaywcjlove/create-tag-action@main
27+
id: tag_release
28+
with:
29+
release: true
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
body: |
32+
${{ steps.changelog.outputs.compareurl }}
33+
34+
${{ steps.changelog.outputs.changelog }}
2035
- name: Publish package on NPM 📦
36+
if: steps.tag_release.outputs.successful
2137
run: npm publish --access public
2238
env:
2339
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)