49
|
1 #!/bin/sh
|
|
2
|
|
3 # Get the highest tag number
|
|
4 VERSION="$(git describe --abbrev=0 --tags)"
|
|
5 VERSION=${VERSION:-'0.0.0'}
|
|
6
|
|
7 # Get number parts
|
|
8 MAJOR="${VERSION%%.*}"; VERSION="${VERSION#*.}"
|
|
9 MINOR="${VERSION%%.*}"; VERSION="${VERSION#*.}"
|
|
10 PATCH="${VERSION%%.*}"; VERSION="${VERSION#*.}"
|
|
11
|
|
12 # Increase version
|
|
13 PATCH=$((PATCH+1))
|
|
14
|
|
15 TAG="${1}"
|
|
16
|
|
17 if [ "${TAG}" = "" ]; then
|
|
18 TAG="${MAJOR}.${MINOR}.${PATCH}"
|
|
19 fi
|
|
20
|
|
21 echo "Releasing ${TAG} ..."
|
|
22
|
|
23 git tag -a -s -m "Release ${TAG}" "${TAG}"
|
|
24 git push --tags
|
|
25 goreleaser release --rm-dist
|