breakhack/build/scripts/release_patch_version.sh

17 lines
590 B
Bash
Raw Normal View History

2018-05-17 08:59:13 +02:00
#!/bin/sh
# Get the current patch version
2018-05-17 09:49:03 +02:00
LAST_VERSION=$(egrep -o 'breakhack_PATCH_VERSION [0-9]+' CMakeLists.txt | awk '{print $2}')
NEXT_VERSION=$((LAST_VERSION + 1))
2018-05-17 08:59:13 +02:00
2018-05-17 09:49:03 +02:00
# Update the version and create release notes
2018-05-17 08:59:13 +02:00
sed -i -e "s/breakhack_PATCH_VERSION [0-9]\+/breakhack_PATCH_VERSION $NEXT_VERSION/" CMakeLists.txt
2018-05-17 09:49:03 +02:00
git log --oneline early-access-v$LAST_VERSION..early-access-v$NEXT_VERSION >> build/releasenotes/early-access-$NEXT_VERSION
2018-05-17 08:59:13 +02:00
git commit -a -m"Patch version raised to $NEXT_VERSION"
2018-05-17 09:49:03 +02:00
# Create the tag
git tag early-access-v$NEXT_VERSION
# Push to repo
git push --follow-tags