Run cron at 04:00 GMT+8; verify the full artifact set, not just the image

- Cron moved to 20:00 UTC (= 04:00 Asia/Shanghai); Actions cron is UTC.
- Add scripts/registry-has-all.sh: a (version, arch) counts as published only
  when the kernel image, the meta-package at that EXACT version, bbrv3-config,
  and (amd64) the headers are all present. A partial previous upload now
  rebuilds instead of being treated as done.
- Use it in all three registry checks: preflight, per-arch pre-build, and the
  pre-publish recheck.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-06-17 18:35:57 +08:00
parent b8ccd431ea
commit b80ce9c786
2 changed files with 69 additions and 25 deletions
+53
View File
@@ -0,0 +1,53 @@
#!/usr/bin/env bash
# Exit 0 only when EVERY artifact a complete publish should contain for the given
# kernel version + Debian architecture is already in the registry's apt index.
# Otherwise list what's missing on stderr and exit 1, so CI rebuilds and fills the
# gap instead of treating a partial upload as "already done".
#
# Should-have set per (version, arch):
# - linux-image-<version>-bbrv3 the kernel image (checked by name)
# - linux-image-bbrv3 == <version> meta-package tracking THIS version
# - bbrv3-config Architecture: all sysctl defaults
# - linux-headers-<version>-bbrv3 amd64 only (arm64 cross build omits headers)
#
# Architecture: all packages (bbrv3-config) appear in every binary-<arch> index,
# so reading the single binary-<arch>/Packages file covers the whole set.
#
# Reads optional PKG_USER / PKG_TOKEN from the environment for authenticated reads.
set -euo pipefail
base=${1:?usage: registry-has-all.sh <registry_base> <dist> <comp> <version> <deb_arch>}
dist=${2:?missing dist}
comp=${3:?missing component}
version=${4:?missing kernel version}
arch=${5:?missing deb arch}
idx=$(curl -fsSL ${PKG_TOKEN:+--user "${PKG_USER:-}:$PKG_TOKEN"} \
"$base/dists/$dist/$comp/binary-$arch/Packages" 2>/dev/null || true)
# Emit one "name|version" line per stanza in the Packages index.
present=$(printf '%s\n' "$idx" | awk '
/^Package:/ { pkg=$2 }
/^Version:/ { ver=$2 }
/^[[:space:]]*$/ { if (pkg != "") print pkg "|" ver; pkg=""; ver="" }
END { if (pkg != "") print pkg "|" ver }
')
has_name() { printf '%s\n' "$present" | awk -F'|' -v n="$1" '$1==n{f=1} END{exit !f}'; }
has_name_ver() { printf '%s\n' "$present" | awk -F'|' -v n="$1" -v v="$2" '$1==n && $2==v{f=1} END{exit !f}'; }
missing=()
has_name "linux-image-$version-bbrv3" || missing+=("linux-image-$version-bbrv3")
has_name_ver "linux-image-bbrv3" "$version" || missing+=("linux-image-bbrv3=$version")
has_name "bbrv3-config" || missing+=("bbrv3-config")
if [ "$arch" = "amd64" ]; then
has_name "linux-headers-$version-bbrv3" || missing+=("linux-headers-$version-bbrv3")
fi
if [ ${#missing[@]} -eq 0 ]; then
echo "Complete artifact set for $version ($arch)."
exit 0
fi
echo "Incomplete for $version ($arch); missing: ${missing[*]}" >&2
exit 1