comparison tools/release.sh @ 49:88a7d4a1ff62 draft

Add release script
author prologic
date Fri, 17 Sep 2021 23:43:22 +0000
parents
children
comparison
equal deleted inserted replaced
48:d004c7c4ddf4 49:88a7d4a1ff62
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