diff --git a/.github/workflows/PublishNPM.yml b/.github/workflows/PublishNPM.yml index a594b9a..e1a23de 100644 --- a/.github/workflows/PublishNPM.yml +++ b/.github/workflows/PublishNPM.yml @@ -22,6 +22,13 @@ jobs: npm run init:npm npm run build:npm cd npm - npm publish --access public + VERSION=$(node -p "require('./package.json').version") + if [[ "$VERSION" == *-* ]]; then + echo "Publishing $VERSION under dist-tag 'beta'" + npm publish --access public --tag beta + else + echo "Publishing $VERSION under dist-tag 'latest'" + npm publish --access public + fi env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}