Merge pull request #219 from neilalexander/semver

Tag releases in master using CI
This commit is contained in:
Neil Alexander 2018-12-07 19:38:01 +00:00 committed by GitHub
commit 4532d0e0c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 3 deletions

BIN
contrib/.DS_Store vendored Normal file

Binary file not shown.

View file

@ -4,7 +4,7 @@
DEVELOPBRANCH="yggdrasil-network/develop"
# Get the last tag
TAG=$(git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*" 2>/dev/null)
TAG=$(git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.0" 2>/dev/null)
# Get last merge to master
MERGE=$(git rev-list $TAG..master --grep "from $DEVELOPBRANCH" 2>/dev/null | head -n 1)
@ -32,7 +32,11 @@ BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Output in the desired format
if [ $PATCH = 0 ]; then
printf 'v%d.%d' "$MAJOR" "$MINOR"
if [ ! -z $FULL ]; then
printf 'v%d.%d.0' "$MAJOR" "$MINOR"
else
printf 'v%d.%d' "$MAJOR" "$MINOR"
fi
else
printf 'v%d.%d.%d' "$MAJOR" "$MINOR" "$PATCH"
fi
@ -43,4 +47,3 @@ if [ $BRANCH != "master" ]; then
printf -- "-%04d" "$BUILD"
fi
fi