File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -e
3
+
4
+ MAJOR_VERSION=$1
5
+ MINOR_VERSION=$2
6
+ TAG_PREFIX=$3
7
+
8
+ # find the latest tag
9
+ NEW_VERSION=" ${TAG_PREFIX} v${MAJOR_VERSION} .${MINOR_VERSION} .0"
10
+ git fetch -q --tags --prune --prune-tags
11
+ tags=$( git tag -l ${TAG_PREFIX} v${MAJOR_VERSION} .${MINOR_VERSION} .* --sort=-version:refname)
12
+ if [[ ! -z " $tags " ]]; then
13
+ arr=(${tags} )
14
+ for val in ${arr[@]} ; do
15
+ if [[ " $val " =~ ^${TAG_PREFIX} v${MAJOR_VERSION} +\. ${MINOR_VERSION} \. [0-9]+$ ]]; then
16
+ prev_build=$( echo ${val} | cut -d. -f3)
17
+ new_build=$(( prev_build+ 1 ))
18
+ NEW_VERSION=" ${TAG_PREFIX} v${MAJOR_VERSION} .${MINOR_VERSION} .${new_build} "
19
+ break
20
+ fi
21
+ done
22
+ fi
23
+
24
+ echo " Version for this commit: ${NEW_VERSION} "
25
+ echo " RELEASE_VERSION=${NEW_VERSION} " >> variables.env
You can’t perform that action at this time.
0 commit comments