Skip to content

Commit

Permalink
Add version check to release.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelGrupp committed May 9, 2024
1 parent dc818bf commit 256b36e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .ci/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ if [ -n "$(git fetch --dry-run)" ]; then
exit 1
fi

hatch version "$NEW_VERSION"

PREVIOUS_VERSION="$(git describe --tags --abbrev=0)"
if [ "$PREVIOUS_VERSION" != "v$(hatch version)" ]; then
echo "Version mismatch between git tag and hatch version"
exit 1
fi

echo "Current version: $PREVIOUS_VERSION"
read -p "Enter new version: " NEW_VERSION
read -p "Enter tag message: " TAG_MESSAGE

hatch version "$NEW_VERSION"

git commit -aem "Bump version to $NEW_VERSION"
git tag -a "$NEW_VERSION" -m "Release $NEW_VERSION: $TAG_MESSAGE"
git push
Expand Down

0 comments on commit 256b36e

Please sign in to comment.