Skip to content

Commit 1d80a78

Browse files
authored
fix: Do not publish loader when there's no new release (#1366)
1 parent 2f621a7 commit 1d80a78

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/publish.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ jobs:
2626
env:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2828
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
# On success, semantic-release will update the version and publish,
30+
# triggering the postversion script that'll update the loader's version
31+
# as well. If nothing was published, the version will still be '0.0.0'.
2932
run: |
3033
node node_modules/semantic-release/bin/semantic-release.js --unstable
3134
cd lib/loader
32-
npm config set "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
33-
npm publish --access public
35+
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
36+
npm config set "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
37+
npm publish --access public
38+
fi
3439
cd ../..

0 commit comments

Comments
 (0)