ci: skip jobs when their package version is already published #41
Reference in New Issue
Block a user
Delete Branch "claude-noether/marfrit-packages:claude-noether/rebuild-guard-2026-05-20"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
CI currently rebuilds all 14 packages on every push, even when only one recipe changed. With the rate of pushes lately (the user said "wir sind aktiv den state of the art zu verändern"), a lot of runner-time goes into rebuilding e.g.
distcc-avahi, which hasn't moved in weeks.This PR adds a per-job guard:
.gitea/scripts/check-already-published.sh— takes a recipe dir (arch/<n>ordebian/<n>), readsPKGBUILD(orbuild-deb.sh+control), resolves the expected pool URL onpackages.reauktion.de, and printsskip=1orskip=0.build.yml— every job gets askip if already publishedstep right afteractions/checkout@v4. Every subsequent step (bootstrap, import-key, deploy-key, makepkg, sign, repo-update, publish) getsif: steps.skip-check.outputs.skip != '1'. Thewipe secretsstep keeps itsif: always().Verified
Live-tested the helper against all 14 recipes against
https://packages.reauktion.de/:Edge cases handled
epoch=(qt6-base-fourier, chromium-fourier, ffmpeg-v4l2-request-fourier) — kept in the pool filename per the live repo's actual layout.pkgname=()arrays (linux-ampere-fourier, qt6-base-fourier) — first name used; split packages share one build so one missing forces all.pkgver=${_pkgver/-/}shell expansion (qt6-base-fourier) — PKGBUILD is sourced in a sandboxed bash subshell so expansions resolve naturally.ffmpeg-v4l2-request-fourier_8.1+rfourier+gb57fbbe-4_arm64.deb).PKGVER=2:${FFMPEG_VERSION}+rfourier+gb57fbbe(mpv, ffmpeg) — top-levelVAR=valuelines are scanned with an awk guard that rejects command-subst ($(...)) and embedded-command (DESTDIR=... meson ...) lines, so HEREDOC-quotedKERNELVER=\$(uname -r)indaedalus-v4l2-dkmsdoesn't poison the parse.Implementation notes
skip=0(build). The guard can only suppress builds, never publish stale binaries.HEADrequests). Negligible vs a 30-60min Mesa build.Two commits
ci: add check-already-published helper scriptci: skip jobs when package already publishedCI currently rebuilds every recipe on every push. distcc-avahi hasn't changed in weeks but still burns runner-time. Add a small bash helper that takes a recipe dir (arch/<n> or debian/<n>), resolves the expected pool URL on packages.reauktion.de, and prints `skip=1` or `skip=0`. Live-tested against all 14 recipes. Sources PKGBUILDs in a sandboxed subshell so epoch=, ${_pkgver/-/}, and pkgname=() arrays resolve correctly. For debian/*, extracts top-level PKGVER/PKGREL lines with an awk guard that rejects command-subst and embedded-command assignments (avoids false-positive matches against HEREDOC-quoted dkms.conf content). Wiring into build.yml lands in the next commit.