passepartout-apple/scripts/commit-release.sh

26 lines
610 B
Bash
Raw Normal View History

#!/bin/sh
CURRENT_BRANCH=`git branch --show-current`
2021-11-16 11:01:54 +00:00
if [[ $CURRENT_BRANCH != "master" ]]; then
echo "Not on master branch"
exit
fi
2021-11-16 11:01:54 +00:00
VERSION=`ci/version-number.sh ios`
2021-10-04 20:59:08 +00:00
DATE=`date "+%Y-%m-%d"`
CHANGELOG_GLOB="Passepartout/App/*/CHANGELOG.md"
2021-11-16 11:01:54 +00:00
COMMIT_MESSAGE="Set release date"
TAG_MESSAGE="Release"
2021-10-06 11:13:36 +00:00
sed -i '' -E "s/^.*Beta.*$/## $VERSION ($DATE)/" $CHANGELOG_GLOB
2021-10-06 11:22:45 +00:00
2021-11-16 11:01:54 +00:00
if ! git commit -am "$COMMIT_MESSAGE"; then
2021-10-06 11:22:45 +00:00
echo "Failed to commit release"
git reset --hard
exit
fi
2021-11-16 11:01:54 +00:00
if ! git tag -as "v$VERSION" -m "$TAG_MESSAGE"; then
2021-10-06 11:22:45 +00:00
echo "Failed to tag release"
git reset --hard HEAD^
exit
fi