Skip to content

Commit b5607b8

Browse files
committed
[fix] Prerelease NPM tag in GitHub action
1 parent dbd7fd4 commit b5607b8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/main.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ on:
33
push:
44
tags:
55
- v*
6+
env:
7+
PUBLISH_TAG: ${{ contains(github.ref_name, '-') && 'next' || 'latest' }}
8+
69
jobs:
7-
Build-and-Publish:
10+
Test-Build-Publish-Deploy:
811
runs-on: ubuntu-latest
912
permissions:
1013
contents: write
@@ -24,11 +27,12 @@ jobs:
2427
run: pnpm i --frozen-lockfile
2528

2629
- name: Build & Publish
27-
run: npm publish --access public --provenance
30+
run: npm publish --access public --provenance --tag ${{ env.PUBLISH_TAG }}
2831
env:
2932
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3033

31-
- name: Update document
34+
- name: Deploy document
35+
if: ${{ env.PUBLISH_TAG == 'latest' }}
3236
uses: peaceiris/actions-gh-pages@v4
3337
with:
3438
publish_dir: ./docs

0 commit comments

Comments
 (0)