[PR #2779] [MERGED] Nightly builds: an opt-in pre-release built each night from the proven union branches #4615

Closed
opened 2026-11-03 05:06:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2779
Author: @ludovic111
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: feat/nightly-channel


📝 Commits (2)

  • d89e271 ci: an opt-in Nightly build from the proven union branches
  • 24800ac ci: hand-started release dry runs get their own concurrency group

📊 Changes

6 files changed (+689 additions, -247 deletions)

View changed files

➕ .github/workflows/game-build.yml (+274 -0)
➕ .github/workflows/nightly-build.yml (+166 -0)
📝 .github/workflows/release.yml (+10 -245)
📝 docs/release-flow.md (+35 -2)
➕ tests/test_nightly.py (+49 -0)
➕ tools/ci/nightly.py (+155 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

Part 1 of the opt-in Nightly channel (#2681). Ludovic decided on 2026-10-27 to do what kacpherek asked, without giving anyone write access. This PR is only the build.

  • nightly-build.yml:
    • Pick (20:17 UTC): builds the newest union/<agent>-<name> branch on origin, when it is newer than main's head and holds something main lacks. Otherwise it builds main. A night with nothing new publishes nothing.
    • Publish: the build goes out as the nightly pre-release, never GitHub's latest. The previous one becomes nightly-<date> for 7 days, and then only those dated nightly tags are deleted.
    • Where it starts: workflow_dispatch (force, dry_run) is available once this is on main.
  • game-build.yml: the release's exporters and build jobs, moved unchanged into a reusable workflow. release.yml and the nightly both call it. The only differences from today:
    • inputs ref, version, nightly (sets HORIZON_NIGHTLY, which the game will show in a later PR);
    • developer_id, so the nightly's macOS build never unlocks the keychain.
  • tools/ci/nightly.py: pick, rotate and prune, with tests in tests/test_nightly.py.
  • docs/release-flow.md:
    • "One channel" now says the release stays every launcher's default and Nightly is opt-in (Ludovic's decision of 2026-10-27).
    • New "Nightly channel" section.

Launchers ignore the nightly tags: they install only vX.Y.Z tags, and so do release_train.py, horizon-server update and install.sh. The launcher setting comes in the next PR, then the version tag in the game.

Why the signing key never meets the union's code

  • Workflows come from main. Every workflow file and script runs from main's copy. A schedule runs the default branch, and uses: ./.github/workflows/game-build.yml takes the caller's commit. The union's own .github/ is never read.
  • build has no secrets. It checks out and compiles the union with a read-only GITHUB_TOKEN, which is not kept in the checkout (persist-credentials: false). On the Mac mini runner, developer_id: false keeps the Developer ID keychain locked, and the programs are signed ad hoc.
  • sign never runs the union's code. It is the only job that holds RELEASE_SIGNING_KEY, from the release environment, which only main enters. It sparse-checks out main's tools/ci/sign_release.sh and nothing else. That script hashes the archives with the runner's sha256sum and signs with its OpenSSL. The archives are read, never executed.
  • A nightly's signature can't pass for a release's. The signed message names the channel: horizon release nightly.
  • publish checks before it publishes. It verifies the signature with main's horizon-release-sign and checks the smoke test (the game drew a world on the Mac mini). Only then does it move the tag, and it never runs the archives either.

The union's code runs only where same-repo pull requests' code already runs (GitHub runners, and the Mac mini runner for parity), without the key.

How tested

python3 -m unittest discover -s tests          336 tests OK (5 new in test_nightly.py)
actionlint nightly-build.yml game-build.yml release.yml
                                               clean, apart from one warning about an unused shell variable that main's release.yml already has
python3 tools/ci/nightly.py pick (local)       picked main 7262304 (no union is newer than main today), notes written

Release dry run on this branch (tests the reusable build that real releases will use): https://github.com/ludovic111/horizon/actions/runs/40502247800, result in the comments.

The nightly workflow itself can only be started by hand once it is on main. After the merge, an agent runs gh workflow run "nightly build" -f dry_run=true before the first real night.

Needs Ludovic

  • Merge by hand: this touches .github/, so the orchestrator reads and merges it.
  • His call: the nightly is signed with the release key (sign job in the release environment), as the brief asks. If he would rather keep a separate key, say so: it would be a nightly environment and a second public key in the launcher.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2779 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/nightly-channel` --- ### 📝 Commits (2) - [`d89e271`](https://github.com/horizon-rust/horizon/commit/d89e27113f1f0ac8d47cf551c1c2070b62d4c006) ci: an opt-in Nightly build from the proven union branches - [`24800ac`](https://github.com/horizon-rust/horizon/commit/24800ac54efa3b26a1f56aea44601fd370403bdc) ci: hand-started release dry runs get their own concurrency group ### 📊 Changes **6 files changed** (+689 additions, -247 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/game-build.yml` (+274 -0) ➕ `.github/workflows/nightly-build.yml` (+166 -0) 📝 `.github/workflows/release.yml` (+10 -245) 📝 `docs/release-flow.md` (+35 -2) ➕ `tests/test_nightly.py` (+49 -0) ➕ `tools/ci/nightly.py` (+155 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Part 1 of the opt-in Nightly channel (#2681). Ludovic decided on 2026-10-27 to do what kacpherek asked, without giving anyone write access. This PR is only the build. - **`nightly-build.yml`**: - **Pick (20:17 UTC):** builds the newest `union/<agent>-<name>` branch on origin, when it is newer than main's head and holds something main lacks. Otherwise it builds main. A night with nothing new publishes nothing. - **Publish:** the build goes out as the **`nightly` pre-release**, never GitHub's latest. The previous one becomes `nightly-<date>` for 7 days, and then only those dated nightly tags are deleted. - **Where it starts:** `workflow_dispatch` (`force`, `dry_run`) is available once this is on main. - **`game-build.yml`:** the release's exporters and build jobs, moved **unchanged** into a reusable workflow. `release.yml` and the nightly both call it. The only differences from today: - inputs `ref`, `version`, `nightly` (sets `HORIZON_NIGHTLY`, which the game will show in a later PR); - `developer_id`, so the nightly's macOS build never unlocks the keychain. - **`tools/ci/nightly.py`:** `pick`, `rotate` and `prune`, with tests in `tests/test_nightly.py`. - **`docs/release-flow.md`:** - "One channel" now says the release stays every launcher's default and Nightly is opt-in (Ludovic's decision of 2026-10-27). - New "Nightly channel" section. Launchers ignore the `nightly` tags: they install only `vX.Y.Z` tags, and so do `release_train.py`, `horizon-server update` and `install.sh`. The launcher setting comes in the next PR, then the version tag in the game. ## Why the signing key never meets the union's code - **Workflows come from main.** Every workflow file and script runs from main's copy. A schedule runs the default branch, and `uses: ./.github/workflows/game-build.yml` takes the caller's commit. The union's own `.github/` is never read. - **`build` has no secrets.** It checks out and compiles the union with a read-only `GITHUB_TOKEN`, which is not kept in the checkout (`persist-credentials: false`). On the Mac mini runner, `developer_id: false` keeps the Developer ID keychain locked, and the programs are signed ad hoc. - **`sign` never runs the union's code.** It is the only job that holds `RELEASE_SIGNING_KEY`, from the `release` environment, which only main enters. It sparse-checks out main's `tools/ci/sign_release.sh` and nothing else. That script hashes the archives with the runner's `sha256sum` and signs with its OpenSSL. The archives are read, never executed. - **A nightly's signature can't pass for a release's.** The signed message names the channel: `horizon release nightly`. - **`publish` checks before it publishes.** It verifies the signature with main's `horizon-release-sign` and checks the smoke test (the game drew a world on the Mac mini). Only then does it move the tag, and it never runs the archives either. The union's code runs only where same-repo pull requests' code already runs (GitHub runners, and the Mac mini runner for parity), without the key. ## How tested ``` python3 -m unittest discover -s tests 336 tests OK (5 new in test_nightly.py) actionlint nightly-build.yml game-build.yml release.yml clean, apart from one warning about an unused shell variable that main's release.yml already has python3 tools/ci/nightly.py pick (local) picked main 7262304 (no union is newer than main today), notes written ``` **Release dry run on this branch** (tests the reusable build that real releases will use): https://github.com/ludovic111/horizon/actions/runs/40502247800, result in the comments. The nightly workflow itself can only be started by hand once it is on main. After the merge, an agent runs `gh workflow run "nightly build" -f dry_run=true` before the first real night. ## Needs Ludovic - **Merge by hand:** this touches `.github/`, so the orchestrator reads and merges it. - **His call:** the nightly is signed with the release key (sign job in the `release` environment), as the brief asks. If he would rather keep a separate key, say so: it would be a `nightly` environment and a second public key in the launcher. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:06:41 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4615
No description provided.