mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 06:05:06 +03:00
Tag releases in master using CI (also checks for v0.x.0 instead of v0.x when deciding version numbers)
This commit is contained in:
parent
8ade7aed62
commit
a7f5c427d4
3 changed files with 19 additions and 4 deletions
BIN
contrib/.DS_Store
vendored
Normal file
BIN
contrib/.DS_Store
vendored
Normal file
Binary file not shown.
|
@ -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)
|
||||
|
@ -31,8 +31,12 @@ MINOR=$(echo $TAG | cut -c 2- | cut -d "." -f 2)
|
|||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
# Output in the desired format
|
||||
if [ $PATCH = 0 ]; then
|
||||
printf 'v%d.%d' "$MAJOR" "$MINOR"
|
||||
if [ $PATCH == 0 ]; then
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue