summaryrefslogtreecommitdiffstats
path: root/tag_release.sh
blob: 97502f0932a2330676d74c5dcf162dd961c01c7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
# Maintained in https://github.com/coreos/repo-templates
# Do not edit downstream.

set -e

[ $# == 2 ] || { echo "usage: $0 <version> <commit>" && exit 1; }

VER=$1
COMMIT=$2

[[ "${VER}" =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-.+)?$ ]] || {
	echo "malformed version: \"${VER}\""
	exit 2
}

[[ "${COMMIT}" =~ ^[[:xdigit:]]+$ ]] || {
	echo "malformed commit id: \"${COMMIT}\""
	exit 3
}

if [ -f Makefile ]; then
	make
else
	./build
fi

git tag --sign --message "stream-metadata-go ${VER}" "${VER}" "${COMMIT}"
git verify-tag --verbose "${VER}"