commit 2a8fb1d180317ffeb62ed9f7ac394fcd6a3fe6d6 parent 307296b6e6849f3b259d859e173dc15b7d990f4b Author: Florian Dold <florian@dold.me> Date: Mon, 18 Aug 2025 18:10:15 +0200 helper script for version bumping Diffstat:
| A | contrib/bump | | | 53 | +++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 53 insertions(+), 0 deletions(-)
diff --git a/contrib/bump b/contrib/bump @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# This file is in the public domain. +set -eu + +if [ $# != 1 ]; then + >&2 echo "Illegal number of arguments" + >&2 echo "Usage: $0 <version>" + exit -1 +fi + +PACKAGE=taler-merchant-demos +VERSION="$1" +DATE="$(date -R)" +GIT_USER="$(git config user.name)" +GIT_EMAIL="$(git config user.email)" + +function updated { + local FILE=$1 + if [[ $(grep "${VERSION}" "${FILE}") ]]; then + echo "${FILE} already in ${VERSION}" + return -1 + fi +} + +set -x + +# update configure.ac +function pyproject { + updated pyproject.toml || return 0 + + sed -i 's/version = .*/version = "'${VERSION}'"/' pyproject.toml + echo "pyproject.toml ${VERSION}" +} + +# update debian/changelog +function debian_changelog { + updated debian/changelog || return 0 + + cat <<EOF > ./debian/changelog.tmp +$PACKAGE (${VERSION}) unstable; urgency=low + + * Release ${VERSION}. + + -- ${GIT_USER} <${GIT_EMAIL}> ${DATE} + +EOF + cat ./debian/changelog >> ./debian/changelog.tmp + mv ./debian/changelog.tmp ./debian/changelog + echo "debian/changelog ${VERSION}" +} + +pyproject +debian_changelog