File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -241,17 +241,18 @@ jobs:
241241 shell : bash
242242 - name : Publish
243243 run : |
244- if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
245- then
246- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
247- npm publish --access public
248- elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
249- then
250- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
251- npm publish --tag next --access public
244+ COMMIT_MSG=$(git log -1 --pretty=%B | head -n1 | xargs)
245+ if [[ "$COMMIT_MSG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
246+ TAG="latest"
247+ elif [[ "$COMMIT_MSG" =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
248+ TAG="next"
252249 else
253250 echo "Not a release, skipping publish"
251+ exit 0
254252 fi
253+
254+ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
255+ npm publish --tag $TAG --access public
255256 env :
256257 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
257258 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments