yad/.ci/set-version.sh
Cursor Agent 5e101408b9 Fix APT repo init and build upstream master from dev CI
Omit the reprepro SignWith field when no GPG key is configured. The
previous value '!' is rejected by reprepro as a missing value.

Build release artifacts from master while keeping workflow and .ci scripts
on dev only. Import CI scripts at runtime and derive versions from the
checked-out upstream commit.

Co-authored-by: KaKi87 <KaKi87@pm.me>
2026-07-12 23:17:45 +02:00

23 lines
660 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
UPSTREAM_VERSION="$(grep '^AC_INIT' configure.ac | sed -E 's/^AC_INIT\(\[[^]]+\], \[([^]]+)\].*/\1/')"
SOURCE_SHA="$(git rev-parse HEAD)"
SHORT_SHA="${SOURCE_SHA:0:7}"
DEB_VERSION="${UPSTREAM_VERSION}-1+git${SHORT_SHA}"
export UPSTREAM_VERSION DEB_VERSION SHORT_SHA SOURCE_SHA
echo "Package version set to ${DEB_VERSION}"
if [[ -n "${GITHUB_ENV:-}" ]]; then
{
echo "UPSTREAM_VERSION=${UPSTREAM_VERSION}"
echo "DEB_VERSION=${DEB_VERSION}"
echo "SHORT_SHA=${SHORT_SHA}"
echo "SOURCE_SHA=${SOURCE_SHA}"
} >> "$GITHUB_ENV"
fi