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
+16 -25
View File
@@ -9,8 +9,9 @@ name: 构建带有BBRv3的内核
on:
workflow_dispatch:
schedule:
# Daily automatic kernel refresh. BBRv3 itself stays pinned to the repo patch.
- cron: "17 3 * * *"
# Daily kernel refresh at 20:00 UTC = 04:00 Asia/Shanghai (GMT+8). Gitea/GitHub
# Actions cron is evaluated in UTC. BBRv3 itself stays pinned to the repo patch.
- cron: "0 20 * * *"
env:
# Gitea Debian package registry for this owner, e.g.
@@ -51,30 +52,24 @@ jobs:
echo "Selected stable kernel: $version"
echo "kernel_version=$version" >> "$GITHUB_OUTPUT"
# Already-published check against the registry's apt index (per arch).
pkg_present() {
local debarch="$1"
curl -fsSL ${PKG_TOKEN:+--user "$PKG_USER:$PKG_TOKEN"} \
"$PKG_REGISTRY/dists/stable/main/binary-$debarch/Packages" 2>/dev/null \
| grep -q "^Package: linux-image-$version-bbrv3$"
}
# Build unless BOTH arches already have their COMPLETE artifact set
# (kernel image + meta@version + config, plus headers on amd64). A partial
# previous upload counts as incomplete and triggers a rebuild.
missing=0
for da in amd64 arm64; do
if pkg_present "$da"; then
echo "linux-image-$version-bbrv3 ($da) already in registry."
if bash scripts/registry-has-all.sh "$PKG_REGISTRY" stable main "$version" "$da"; then
echo "All artifacts for $version ($da) already in registry."
else
echo "linux-image-$version-bbrv3 ($da) missing."
missing=1
fi
done
if [ "$missing" -eq 1 ]; then
echo "build_needed=true" >> "$GITHUB_OUTPUT"
echo "At least one arch for $version is missing; build will continue."
echo "At least one arch for $version is incomplete; build will continue."
else
echo "build_needed=false" >> "$GITHUB_OUTPUT"
echo "All arches for $version already published; ending before build."
echo "All arches for $version fully published; ending before build."
fi
build:
@@ -111,14 +106,12 @@ jobs:
id: check_present
run: |
set -euo pipefail
if curl -fsSL ${PKG_TOKEN:+--user "$PKG_USER:$PKG_TOKEN"} \
"$PKG_REGISTRY/dists/stable/main/binary-$DEB_ARCH/Packages" 2>/dev/null \
| grep -q "^Package: linux-image-$KERNEL_VERSION-bbrv3$"; then
if bash scripts/registry-has-all.sh "$PKG_REGISTRY" stable main "$KERNEL_VERSION" "$DEB_ARCH"; then
echo "BUILD_NEEDED=false" >> "$GITHUB_ENV"
echo "linux-image-$KERNEL_VERSION-bbrv3 ($DEB_ARCH) already published; skipping."
echo "Full artifact set for $KERNEL_VERSION ($DEB_ARCH) present; skipping."
else
echo "BUILD_NEEDED=true" >> "$GITHUB_ENV"
echo "linux-image-$KERNEL_VERSION-bbrv3 ($DEB_ARCH) missing; building."
echo "Artifact set for $KERNEL_VERSION ($DEB_ARCH) incomplete; building."
fi
- name: 安装依赖项
@@ -232,14 +225,12 @@ jobs:
if: env.BUILD_NEEDED == 'true'
run: |
set -euo pipefail
if curl -fsSL ${PKG_TOKEN:+--user "$PKG_USER:$PKG_TOKEN"} \
"$PKG_REGISTRY/dists/stable/main/binary-$DEB_ARCH/Packages" 2>/dev/null \
| grep -q "^Package: linux-image-$KERNEL_VERSION-bbrv3$"; then
if bash scripts/registry-has-all.sh "$PKG_REGISTRY" stable main "$KERNEL_VERSION" "$DEB_ARCH"; then
echo "PUBLISH_NEEDED=false" >> "$GITHUB_ENV"
echo "Published while this job was running; skipping upload."
echo "Full set published while this job was running; skipping upload."
else
echo "PUBLISH_NEEDED=true" >> "$GITHUB_ENV"
echo "Still missing; publishing this build."
echo "Set still incomplete; publishing this build."
fi
- name: 发布到 Gitea Debian registry