release tool
Some checks failed
Test / build (push) Waiting to run
Build / build (push) Has been cancelled

This commit is contained in:
Chuck Smith
2024-03-24 12:19:13 -04:00
parent 5574c23597
commit 005f3b6a13
2 changed files with 47 additions and 0 deletions

25
tools/release.sh Normal 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