mirror of
https://git.mills.io/prologic/zs
synced 2024-11-25 06:46:11 +03:00
26 lines
511 B
Bash
Executable File
26 lines
511 B
Bash
Executable File
#!/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
|