ci/nightly: SHA-gate cron, publish dated nightly-* releases, BUILD_ID in os-release#2111
Merged
Merged
Conversation
… in os-release The nightly cron at 22:30 UTC currently rebuilds ~90 boards even when HEAD hasn't moved since the last published build, then overwrites a single rolling `latest` GitHub release that erases all history of prior nightlies. Three coordinated changes here: 1. Preflight job in build.yml compares HEAD to the `sha=` recorded in the rolling `nightly` release body and short-circuits the matrix on `schedule` events when they match. PRs and workflow_dispatch always build. 2. The matrix now publishes to three release tags: dated `nightly-YYYYMMDD-<short>` (prerelease, content-addressable), rolling `nightly` (the channel pointer), and `latest` (legacy alias kept for one cycle so existing sysupgrade clients hitting the old URL don't break). 3. `general/scripts/rootfs_script.sh` adds BUILD_ID and BUILD_SHA to /usr/lib/os-release with sensible local-build fallbacks. The buildroot job exports these from the preflight outputs so the rootfs picks them up; the Telegram caption gains `Build: <build_id>` and drops the now-empty `Tag:` line. This is PR-A of six; subsequent PRs add a manifest aggregator on gh-pages, retention sweep, sysupgrade --channel/--build/--list-builds, host-side openipc-bisect, build-one.yml commit input, and downstream image.yml wiring. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR-A of six in the nightly-build redesign. Touches only CI and one rootfs script; no on-device flag day.
preflightjob inbuild.ymlreads thesha=line from the rollingnightlyrelease body and skips the matrix onscheduleevents when HEAD matches. PRs andworkflow_dispatchalways build (this PR will itself trigger a full matrix as proof).nightly-YYYYMMDD-<short>(prerelease, content-addressable, the unit of history),nightly(rolling channel pointer, body carriessha=/short=/built_at=),latest(legacy alias, kept one cycle so existing camera sysupgrade clients on the old hardcoded URL don't break).BUILD_ID/BUILD_SHAin/usr/lib/os-release— emitted fromgeneral/scripts/rootfs_script.sh. Localmake BOARD=…builds keep working via alocal-YYYYMMDD-<hash>fallback. Thebuildrootjob exportsBUILD_ID/BUILD_SHAfrom preflight outputs at the job level so the rootfs script sees them and so the Telegram caption can reference them.Build: nightly-YYYYMMDD-<short>(theTag: ${TAG_NAME}line is gone because the now-dead workflow-levelenv: TAG_NAME: latestwas removed).This PR is reviewable as ~70 lines of YAML + 2 lines of shell. Subsequent PRs (sequenced):
gh-pages+ retention sweepsysupgrade --channel/--build/--list-builds(pure busybox)contrib/openipc-bisect(independent)build-one.ymlaccepts arbitrary commit (independent)image.ymldownstream ofbuild.ymlviaworkflow_runNotes for reviewers
nightlyrelease doesn't exist yet,gh release view nightlyerrors,PREVis empty, and the gate falls through to build. The first cron after merge always builds.nightly-*releases have been published leaves those tags orphaned. They're harmless (no consumer yet — PR-B introduces the manifest), but happy to add acontrib/cleanup-nightly-tags.shone-shot in a follow-up if you'd prefer a clean revert path.Test plan
pull_request) and the full ~90-board matrix completes — proves the gate doesn't break the non-schedule path.workflow_dispatchproduces both a datednightly-YYYYMMDD-<short>release and updates the rollingnightly(check release bodies containsha=).Preflightjob appears in the run, ~10s.cat /etc/os-release | grep BUILD_showsBUILD_ID=nightly-…andBUILD_SHA=<40-hex>.Build: nightly-….🤖 Generated with Claude Code