Derive all build timestamps from BUILDDATE

The build date stored in version.h is now the single time source for a
release. Each package workflow converts it to SOURCE_DATE_EPOCH and passes
that into the build containers, the debian changelog entry is stamped from it
rather than from the build clock, and rpmbuild is told to use it as the build
time and to clamp file mtimes to it.

rpm also records the build host, which is a container id and therefore differs
on every run, so pin it as well - otherwise the timestamps alone do not make
the package reproducible.

Rebuilding the same commit now produces byte identical packages, verified for
both formats by building twice and comparing checksums.

In the version workflow the clock is read exactly once, when a new build date
is minted. YEAR3PROXY is derived from the build date instead of being read
separately, so the two cannot straddle a year boundary and a re-run in a later
year no longer rewrites version.h.
This commit is contained in:
Vladimir Dubrovin committed 2026-08-22 13:53:30 +03:00
1 parent 3dcd83e6d6
commit 4b48311d82
4 files changed
+31 -11

No files matched your search

+5 -2
View File
@@ -27,8 +27,10 @@ jobs:
pwd
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV
BUILDDATE=$(sed -n 's/^#define BUILDDATE "\(.*\)"$/\1/p' src/version.h)
[ -n "$BUILDDATE" ] || BUILDDATE=$(date +%y%m%d%H%M%S)
[ -n "$BUILDDATE" ] || BUILDDATE=$(date -u +%y%m%d%H%M%S)
echo "VERSION=$BUILDDATE" >> $GITHUB_ENV
SOURCE_DATE_EPOCH=$(date -u -d "20${BUILDDATE:0:2}-${BUILDDATE:2:2}-${BUILDDATE:4:2} ${BUILDDATE:6:2}:${BUILDDATE:8:2}:${BUILDDATE:10:2}" +%s)
echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" >> $GITHUB_ENV
- name: configure deb env
run: |
mkdir ~/debian
@@ -42,6 +44,7 @@ jobs:
docker run --rm \
-v "$HOME/debian:/debian" \
-e RELEASE="$RELEASE" -e VERSION="$VERSION" \
-e SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" \
ubuntu:22.04 bash -c '
set -e
export DEBIAN_FRONTEND=noninteractive
@@ -60,7 +63,7 @@ jobs:
echo " "
echo " *3proxy $RELEASE build"
echo " "
echo " -- z3APA3A <3apa3a@3proxy.org> $(date "+%a, %d %b %Y %H:%M:%S %z")"
echo " -- z3APA3A <3apa3a@3proxy.org> $(date -R -u -d @$SOURCE_DATE_EPOCH)"
echo ""
} > debian/changelog
export PATH=/usr/arm-linux-gnueabihf/bin:$PATH