Skip to content

Commit

Permalink
chore: qol improvements to local release scripts (#10836)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardfoyle authored Aug 3, 2022
1 parent 63fca8d commit f7e6b81
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"commit": "git-cz",
"coverage": "codecov || exit 0",
"release-rc": "./scripts/release-rc.sh",
"promote-rc": "./scripts/promote-rc.sh"
"promote-rc": "./scripts/promote-rc.sh",
"finish-release": "./scripts/finish-release.sh"
},
"bugs": {
"url": "https://github.com/aws-amplify/amplify-cli/issues"
Expand Down
20 changes: 15 additions & 5 deletions scripts/finish-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,22 @@ git checkout -B dev-main-merge
git fetch "$remote_name" dev
git reset --hard "$remote_name"/dev
git fetch "$remote_name" main
git merge "$remote_name"/main
read -p 'Resolve any merge conflicts, then press any key to continue'
git push "$remote_name" dev-main-merge
read -p 'Open a PR for the dev-main-merge branch against dev and get it approved. DO NOT MERGE THE PR. Press any key once the PR is approved'
git merge "$remote_name"/main -m "Merge release commit from main to dev" || merge_exit_code=$? || true
if [[ $merge_exit_code != 0 ]]; then
# could not automatically merge
echo "Resolve merge conflicts then resume script by running 'kill -CONT $$'"
kill -TSTP $$
git push "$remote_name" dev-main-merge --force --no-verify
compare_link=https://github.com/aws-amplify/amplify-cli/compare/dev...dev-main-merge
open "$compare_link"
echo "Double check the release merge at the compare link that just opened"
echo "(If it did not open, navigate to $compare_link)"
echo "If something looks wrong, fix up the merge and run 'git push "$remote_name" dev-main-merge --force --no-verify'"
echo "Once the changes look good, run 'kill -CONT $$' to resume this script."
kill -TSTP $$
fi
git switch dev
git pull "$remote_name" dev
git merge dev-main-merge --ff-only
git push "$remote_name" dev
echo "Release commit successfully merged onto main!"
echo "Dev branch successfully fast-forwarded to the release merge commit!"
10 changes: 7 additions & 3 deletions scripts/release-rc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ branch_name="release_rc/$rc_sha"

git checkout -B "$branch_name" "$rc_sha"
git fetch "$remote_name" main
git merge "$remote_name"/main
read -p 'Resolve any merge conflicts, then press any key to continue'
git merge "$remote_name"/main || merge_exit_code=$? || true
if [[ $merge_exit_code != 0 ]]; then
# could not automatically merge
echo "Resolve merge conflicts and resume release candidate publish by running 'kill -CONT $$'"
kill -TSTP $$
fi
git push "$remote_name" "$branch_name"
echo "CCI is publishing the release candidate. Check progress at"
echo "CircleCI is publishing the release candidate. Check progress at"
echo "https://app.circleci.com/pipelines/github/$repo_name?branch=$branch_name"

0 comments on commit f7e6b81

Please sign in to comment.