Next tag script

This commit is contained in:
Fordnox committed 2020-11-02 03:03:26 +02:00
1 parent a9974e3a44
commit 4008a5a4b4
2 files changed
+32

No files matched your search

+8
View File
@@ -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
+24
View File
@@ -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