diff --git a/Makefile b/Makefile index ae516e34d..e02134e81 100644 --- a/Makefile +++ b/Makefile @@ -63,3 +63,11 @@ release: ## App release npm install grunt ant release + +tag: ## Tag new release on GitHub + sh ./bin/next-tag.sh + #NEW_TAG=$(shell ./bin/next-tag.sh); + #echo $(NEW_TAG) + #git tag $NEW_TAG + #git push --tags + #git push diff --git a/bin/next-tag.sh b/bin/next-tag.sh new file mode 100755 index 000000000..139102c02 --- /dev/null +++ b/bin/next-tag.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#get highest tag number +VERSION=`git describe --abbrev=0 --tags 2>/dev/null` + +if [ -z $VERSION ];then + NEW_TAG="1.0.0" +fi + +#replace . with space so can split into an array +VERSION_BITS=(${VERSION//./ }) + +#get number parts and increase last one by 1 +VNUM1=${VERSION_BITS[0]} +VNUM2=${VERSION_BITS[1]} +VNUM3=${VERSION_BITS[2]} +VNUM3=$((VNUM3+1)) + +#create new tag +NEW_TAG="${VNUM1}.${VNUM2}.${VNUM3}" + +echo $NEW_TAG + +exit 0 \ No newline at end of file