summaryrefslogtreecommitdiffstats
path: root/bin/git-debian-release
blob: 9a7b4b79e3fd06ff8f6b22353a4dc3a906d905cb (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
30
31
32
33
#!/bin/sh

set -e

GBP_CONF_FILES="/dev/null"
export GBP_CONF_FILES

if [ -n "$(git config --get user.signingKey)" ]
then
	GIT_OPTIONS="-S"
fi

if [ ! -e debian/changelog ]
then
	echo "E: debian/changelog - no such file" >&2
	exit 1
fi

MODE="$(basename ${0} | sed -e 's|^git-||' -e 's|-release$||')"

if [ -n "${1}" ]
then
	VERSION="${1}"
else
	VERSION="$(dpkg-parsechangelog | awk '/^Version: / { print $2 }')"
fi

HASH="${2}"

git add -A

git commit -a -s -m "Releasing ${MODE} version ${VERSION}." ${GIT_OPTIONS}
git-${MODE}-tag ${VERSION} ${HASH}