donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit 29bdf7af411210a99c7e9c1bd7b3ddd2f13b5cd2
parent 42d1c1d892dd9dccfba8793ae255a0f609c542b1
Author: Florian Dold <dold@taler.net>
Date:   Tue,  8 Sep 2026 20:41:50 +0200

CI: derive Debian package versions from release tags

Restore the missing version helper using full local Git history and the
latest non-development release tag. Separate assignment from export so
version lookup failures stop packaging instead of passing an empty value.

Diffstat:
Mcontrib/ci/debian-package-job.sh | 3++-
Acontrib/ci/version.sh | 14++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/contrib/ci/debian-package-job.sh b/contrib/ci/debian-package-job.sh @@ -12,7 +12,8 @@ apt-get update apt-get upgrade -y mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control -export VERSION="$(./contrib/ci/version.sh)" +VERSION="$(./contrib/ci/version.sh)" +export VERSION echo "Building package version ${VERSION}" EMAIL=none gbp dch --dch-opt=-b --ignore-branch --debian-tag="%(version)s" --git-author --new-version="${VERSION}" ./bootstrap diff --git a/contrib/ci/version.sh b/contrib/ci/version.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# This file is in the public domain. +# Determine the Debian package version from the full checkout and release tags. +set -eu + +tag=$(git describe --tags --match 'v*.*.*' --exclude '*-dev*' --abbrev=0 HEAD) +commits=$(git rev-list "${tag}..HEAD" --count) + +if [ "${commits}" = "0" ]; then + printf '%s\n' "${tag#v}" +else + revision=$(git rev-parse --short=8 HEAD) + printf '%s-%s-%s\n' "${tag#v}" "${commits}" "${revision}" +fi