Skip to content

Commit 7ffcf32

Browse files
author
郑培鑫
committed
ci: update workflows
1 parent b1735a7 commit 7ffcf32

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
3-
tags:
4-
- 'v*'
3+
branches:
4+
- dev
55
permissions:
66
contents: write
77
pull-requests: write
@@ -14,7 +14,12 @@ jobs:
1414
id: release
1515
with:
1616
release-type: node
17+
target-branch: dev
18+
# The logic below handles the npm publication:
1719
- uses: actions/checkout@v4
20+
# these if statements ensure that a publication only occurs when
21+
# a new release is created:
22+
if: ${{ steps.release.outputs.release_created }}
1823
- uses: actions/setup-node@v4
1924
with:
2025
node-version: 16
@@ -24,6 +29,8 @@ jobs:
2429
version: 8
2530
- run: pnpm i
2631
- run: pnpm build
27-
- uses: JS-DevTools/npm-publish@v3
28-
with:
29-
token: ${{ secrets.NPM_TOKEN }}
32+
if: ${{ steps.release.outputs.release_created }}
33+
- run: npm publish
34+
env:
35+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
36+
if: ${{ steps.release.outputs.release_created }}

0 commit comments

Comments
 (0)