Add tag script

This commit is contained in:
James Shubin
2015-10-02 11:05:19 -04:00
parent 66e030a175
commit 3e4709d9da

11
tag.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
# TODO: don't run if current HEAD is already tagged (ensure this is idempotent)
# take current HEAD with new version
v=`git describe --match '[0-9]*\.[0-9]*\.[0-9]*' --tags --abbrev=0`
t=`echo "${v%.*}.$((${v##*.}+1))"` # increment version
echo "Version $t is now tagged!"
echo "Pushing $t to origin..."
echo "Press ^C within 3s to abort."
sleep 3s
git tag $t
git push origin $t