From e1093f9e43e52e5085731f25bedc4f4979970622 Mon Sep 17 00:00:00 2001 From: Oskar Thoren Date: Tue, 16 Jan 2018 19:51:30 +0900 Subject: [PATCH] Script for tagging releases --- scripts/tag-release.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/tag-release.sh diff --git a/scripts/tag-release.sh b/scripts/tag-release.sh new file mode 100755 index 0000000000..2da4e15653 --- /dev/null +++ b/scripts/tag-release.sh @@ -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"