Add release script

git-svn-id: file:///srv/svn/repo/aya/trunk@50 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
prologic
2021-09-17 23:43:22 +00:00
parent 62d3f42153
commit 4fec9cbc5f
3 changed files with 68 additions and 0 deletions

25
tools/release.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
# Get the highest tag number
VERSION="$(git describe --abbrev=0 --tags)"
VERSION=${VERSION:-'0.0.0'}
# Get number parts
MAJOR="${VERSION%%.*}"; VERSION="${VERSION#*.}"
MINOR="${VERSION%%.*}"; VERSION="${VERSION#*.}"
PATCH="${VERSION%%.*}"; VERSION="${VERSION#*.}"
# Increase version
PATCH=$((PATCH+1))
TAG="${1}"
if [ "${TAG}" = "" ]; then
TAG="${MAJOR}.${MINOR}.${PATCH}"
fi
echo "Releasing ${TAG} ..."
git tag -a -s -m "Release ${TAG}" "${TAG}"
git push --tags
goreleaser release --rm-dist