Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions scripts/release/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ VERSION_SHA=$(git blame -- package.json | grep '"version":' | cut -d' ' -f1)
VERSION=$(jq -r .version package.json)

# Create a new branch with the changes to release
git switch -c "$BRANCH" "$VERSION_SHA"
git push origin HEAD
git branch "$BRANCH" "$VERSION_SHA"
git push -u origin "$BRANCH"
git branch -D "$BRANCH"


if ! which gh >/dev/null; then
# GitHub CLI not installed - clean up and prompt for manual branch creation
git switch "$BASE_BRANCH"
git branch -D "$BRANCH"
echo "Open a PR: https://github.com/salesforce/lwc/pull/new/$BRANCH"
exit 0
fi
Expand All @@ -44,14 +44,11 @@ if [ -n "$WORK_ITEM" ]; then
fi
# Use GitHub CLI to create a PR and wait for CI checks to pass
gh pr create -t "$PR_TITLE" -b '' -B "$RELEASE_BRANCH" -H "$BRANCH"
# Clean up locally
git switch "$BASE_BRANCH"
git branch -D "$BRANCH"

# Wait for CI to complete
sleep 3 # Give GitHub time to kick off CI
. "$(dirname "$0")/wait-for-pr.sh" "$BRANCH"
if ! gh pr checks --fail-fast --watch; then
if ! gh pr checks "$BRANCH" --fail-fast --watch; then
echo 'CI failed. Cannot continue with release.'
gh pr view "$BRANCH" --web
exit 1
Expand Down
6 changes: 4 additions & 2 deletions scripts/release/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ if ! gh >/dev/null; then
fi

# Use GitHub CLI to create a PR and wait for it to be merged before exiting
gh pr create -t "$VERSION_BUMP_MESSAGE" -b ''
gh pr merge --auto --squash --delete-branch
gh pr create -t "$VERSION_BUMP_MESSAGE" -b '' -B "$BASE_BRANCH" -H "$BRANCH"
# Squash on master, but not backports
[ "$BASE_BRANCH" == 'master' ] && SQUASH='--squash'
gh pr merge --auto --delete-branch $SQUASH
git switch "$BASE_BRANCH"
git branch -D "$BRANCH"

Expand Down