Skip to content

Commit 5485ae1

Browse files
committed
Update publish-npm.yml
1 parent b3980af commit 5485ae1

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

.github/workflows/publish-npm.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ on:
55
- v0.*
66

77
jobs:
8-
publish:
9-
if: { github.ref == 'refs/heads/master' }
8+
publish-version:
9+
name: Publish new npm version
10+
if: github.ref == 'refs/heads/master' && ${{ !endsWith(github.ref, '-beta') }}
1011
runs-on: ubuntu-latest
1112
steps:
1213
- uses: actions/checkout@v3
@@ -17,15 +18,23 @@ jobs:
1718
- run: yarn
1819
- run: yarn test
1920
- run: yarn build
20-
21-
- name: Beta
22-
if: ${{ endsWith(github.ref, '-beta') }}
23-
run: yarn publish --tag beta
21+
- run: yarn publish
2422
env:
2523
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2624

27-
- name: Current version
28-
if: ${{ !endsWith(github.ref, '-beta') }}
29-
run: yarn publish
25+
publish-beta:
26+
name: Publish new npm beta version
27+
if: ${{ endsWith(github.ref, '-beta') }}
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: actions/setup-node@v3
32+
with:
33+
node-version: '16.x'
34+
registry-url: 'https://registry.npmjs.org'
35+
- run: yarn
36+
- run: yarn test
37+
- run: yarn build
38+
- run: yarn publish --tag beta
3039
env:
3140
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)