Skip to content

Commit

Permalink
fix order of package change detection and push all git changes, not j…
Browse files Browse the repository at this point in the history
…ust tags
  • Loading branch information
gingerbenw committed Oct 31, 2023
1 parent 3ef324f commit 31276d4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ cd /app/bugsnag-js
npm ci
npm run bootstrap -- --ci

# check if CDN packages changed – if they didn't we don't need to upload to the CDN
BROWSER_PACKAGE_CHANGED=$(npx lerna changed --parseable | grep -c packages/js$ || test $? = 1;)
WORKER_PACKAGE_CHANGED=$(npx lerna changed --parseable | grep -c packages/web-worker$ || test $? = 1;)

# increment package version numbers
if [ -z "$RETRY_PUBLISH" ]; then
if [ -z "${RETRY_PUBLISH:-}" ]; then
case $VERSION in
"prerelease" | "prepatch" | "preminor" | "premajor")
npx lerna version "$VERSION" --dist-tag next --no-push
Expand All @@ -50,20 +54,16 @@ npx lerna run build \
--ignore @bugsnag/plugin-electron-app \
--ignore @bugsnag/plugin-electron-client-state-persistence

# push git tags
git push origin --tags
# push local changes and tags
git push origin --follow-tags

# publish
if [ -z "$RETRY_PUBLISH" ]; then
if [ -z "${RETRY_PUBLISH:-}" ]; then
npx lerna publish from-git
else
npx lerna publish from-package
fi

# check if CDN packages changed – if they didn't we don't need to upload to the CDN
BROWSER_PACKAGE_CHANGED=$(npx lerna changed --parseable | grep -c packages/js$ || test $? = 1;)
WORKER_PACKAGE_CHANGED=$(npx lerna changed --parseable | grep -c packages/web-worker$ || test $? = 1;)

if [ "$BROWSER_PACKAGE_CHANGED" -eq 1 ] || [ -v FORCE_CDN_UPLOAD ]; then
npx lerna run cdn-upload --stream --scope @bugsnag/browser
fi
Expand Down

0 comments on commit 31276d4

Please sign in to comment.