Roll back release on git errors

This commit is contained in:
Davide De Rosa 2021-10-06 13:22:45 +02:00
parent d629540c18
commit 9ca015e42f
1 changed files with 12 additions and 1 deletions

View File

@ -10,4 +10,15 @@ DATE=`date "+%Y-%m-%d"`
CHANGELOG_GLOB="Passepartout/App/*/CHANGELOG.md"
MESSAGE="Release"
sed -i '' -E "s/^.*Beta.*$/## $VERSION ($DATE)/" $CHANGELOG_GLOB
git commit -am $MESSAGE && git tag -as "v$VERSION" -m $MESSAGE
if ! git commit -am $MESSAGE; then
echo "Failed to commit release"
git reset --hard
exit
fi
if ! git tag -as "v$VERSION" -m $MESSAGE; then
echo "Failed to tag release"
git reset --hard HEAD^
exit
fi