Skip to content

Commit

Permalink
Change release script to use a branch for the release.
Browse files Browse the repository at this point in the history
  • Loading branch information
orium committed Nov 5, 2023
1 parent 0a6de0a commit cf23931
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ echo "Current version is $(project_version)."
echo -n "Which version do you want to release? "
read release_version

if ! grep "^## " release-notes.md | head -1 | grep --silent "^## $release_version$"; then
echo "You forgot to update the release notes." >&2
exit 1
fi

echo -n "Which will be the next version? "
read next_version

Expand Down Expand Up @@ -80,6 +75,16 @@ fi

echo "done."

release_branch="release-v$release_version"

git checkout -b $release_branch

while ! grep "^## " release-notes.md | head -1 | grep --silent "^## $release_version$"; then
echo "There's no entry for this version in the release notes."
echo -n "Go ahead and add them and press enter when you're done... "
read
fi

set_version "$release_version"

git commit -am "Release v${release_version}."
Expand All @@ -89,7 +94,7 @@ set_version "$next_version"

git commit -am "Bump to version $next_version."

echo "Check if everything is alright. If so do:"
echo "Check if everything is alright. If so, open a PR, merge it, and then do:"
echo
echo " git push --atomic origin $MAIN_BRANCH v${release_version} && git checkout v${release_version} && cargo publish && git checkout $MAIN_BRANCH"
echo " git checkout $MAIN_BRANCH && git pull && git br -d $release_branch && git checkout v${release_version} && cargo publish && git checkout $MAIN_BRANCH"
echo

0 comments on commit cf23931

Please sign in to comment.