docker-bitcoind/scripts/new-release.sh
Damian Mee 1feef9f6ac
Simplify build (#31)
* 1st Attempt at self-contained Dockerfile

* Fix build

* bulk change

* fixes

* 0.17.1 -> 0.17.2

* Only build 0.17

* Only build 0.16

* build all

* (Hopefully) fix 0.16

* simplify test workflow

* Try building 0.18 w/o emoji patch

* REALLY FUCKING FIXED

* Moved something to somewhere... goodnight...

* minor workflows improvements

* simplify & consistency++ of qemu perf script

* simplify qemu reference;  better GH release

* qemu-perf & qemu consistency++

* reverts brainfart

* consistency changes

* Comment style

* Add v0.18.1 fix to make tests pass

* Move APP to be a workflow-level variable

* simplify GPG

* Update actions/github-script version

* merge annotations into a single step

* bettermore

* morebettermore

* Add helper script to create new releases

* Enable Docker experimental with less lines
2020-03-13 23:25:46 +08:00

57 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail
#
## Given version, this script creates & pushes a relevant git-tag.
#
# required version
VERSION=$1
# Verify version to-be-released is provided
if [[ -z "$VERSION" ]]; then
>&2 printf "\nERR: version missing: version needs to be passed as the first argument. Try:\n"
>&2 printf "\t./%s %s\n\n" "$(basename "$0")" "v0.19.1"
exit 1
fi
# Get directory
DIR="$(echo "${VERSION#v}" | cut -d. -f-2)"
# Verify there's no uncommitted changes in the working dir
if [[ -n "$(git status --untracked-files=no --porcelain)" ]]; then
>&2 printf "\nERR: working directory not clean. Commit, or stash changes to continue.\n\n"
exit 1
fi
if ! grep -q "${VERSION#v}" "$DIR/Dockerfile" ; then
>&2 printf "\nERR: Requested version not present in Dockerfile. Make sure that's what you want to do.\n\n"
exit 1
fi
git fetch --tags
# Get last build number
LAST="$(git tag | grep '+build' | sed 's|^.*build||' | sort -h | tail -n 1)"
LAST="${LAST:-0}"
# Increment it
((LAST++))
TAG="$VERSION+build$LAST"
printf "Creating tag: %s…\t" "$TAG"
git tag -sa "$TAG" -m "$TAG"
echo "done"
printf "Pushing tag: %s…\t" "$TAG"
git push origin "$TAG"
echo "All done"