bitcask-mirror/tools/release.sh

33 lines
671 B
Bash
Raw Normal View History

#!/bin/bash
2019-03-09 12:41:59 +00:00
# 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#*.}"
2019-03-09 12:41:59 +00:00
# Increase version
PATCH=$((PATCH + 1))
2019-03-09 12:41:59 +00:00
TAG="${1}"
if [ "${TAG}" = "" ]; then
TAG="${MAJOR}.${MINOR}.${PATCH}"
fi
echo "Releasing ${TAG} ..."
git-chglog --next-tag="${TAG}" --output CHANGELOG.md
git commit -a -m "Update CHANGELOG for ${TAG}"
2019-04-25 12:19:20 +00:00
git tag -a -s -m "Release ${TAG}" "${TAG}"
2019-03-09 12:41:59 +00:00
git push --tags
goreleaser release \
--rm-dist \
--release-notes <(git-chglog "${TAG}" | tail -n+5)