Script for tagging releases

This commit is contained in:
Oskar Thoren 2018-01-16 19:51:30 +09:00
parent eb17f24f0b
commit e1093f9e43
No known key found for this signature in database
GPG Key ID: 5128AB0637CD85AF
1 changed files with 26 additions and 0 deletions

26
scripts/tag-release.sh Executable file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -eof pipefail
if [ $# -eq 0 ]
then
echo "Need to supply a release tag"
exit 0
fi
TAG=$1
if $(git tag | grep -q $TAG); then
echo "Tag $TAG exists, replacing"
git tag --delete $TAG
git push --delete origin $TAG
else
echo "New tag $TAG"
fi
git tag -s -a $TAG -m "Release $TAG"
# NOTE(oskarth): Alt. that requires two pushes: git push origin $TAG
git push --follow-tags
echo "Done"