-
-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b1aaff
commit e44c20a
Showing
2 changed files
with
30 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#! /usr/bin/env bash | ||
|
||
NEW_VERSION=$1 | ||
if [ -z "${NEW_VERSION}" ]; then | ||
echo "Usage: ./prepare-release.sh NEW_VERSION_NUMBER" | ||
exit 1 | ||
fi | ||
|
||
git switch develop | ||
git fetch origin | ||
git diff origin/develop | if [ "$0" = "" ]; then | ||
echo "git diff found local changes on develop branch, cannot cut release." | ||
elif [ "$NEW_VERSION" = "" ]; then | ||
echo "No version set. Are you just copying and pasting this without checking?" | ||
else | ||
git pull origin develop --ff-only | ||
git switch -c "prepare-${NEW_VERSION}" | ||
|
||
# exit early if the script fails | ||
./update-versions.sh "${NEW_VERSION}" || exit $? | ||
|
||
# sanity check the diffs, but not Cargo.lock files cuz ugh | ||
git diff -- . ':(exclude)Cargo.lock' | ||
|
||
# send it all to github | ||
git commit -a -m "Update version to ${NEW_VERSION}" | ||
git push --set-upstream origin "prepare-${NEW_VERSION}" | ||
fi | ||
|