[PR #213] [MERGED] Sign and notarize the macOS builds with Developer ID #2410

Closed
opened 2026-11-02 15:55:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/macos-signing


📝 Commits (1)

  • 3ffbb1c Sign and notarize the macOS builds with Developer ID

📊 Changes

7 files changed (+314 additions, -25 deletions)

View changed files

📝 .github/workflows/launcher.yml (+17 -2)
📝 .github/workflows/release.yml (+32 -2)
📝 launcher/src/backend.rs (+40 -2)
📝 packaging/macos/README.md (+64 -14)
➕ packaging/macos/keychain.sh (+99 -0)
➕ packaging/macos/notarize.sh (+37 -0)
📝 packaging/macos/package.sh (+25 -5)

📄 Description

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

Signs the macOS launcher (Horizon.app and the .dmg) and the game's programs with Ludovic's Developer ID, with the hardened runtime and a secure timestamp, then notarizes them and staples the ticket where one can be held.

What changes

  • packaging/macos/keychain.sh manages a keychain of the Mac mini's own, horizon-signing.keychain-db.
    • It holds only "Developer ID Application: Ludovic Marie (YYJU63HSD4)", Apple's G1 intermediate and the notarytool profile horizon-notary (the Agents vault's App Store Connect team key).
    • The release runner's jobs run in their own security session, where the login keychain is locked, so it can't sign from there. unlock reads this keychain's password from 1Password (item "Horizon signing keychain"), unlocks it, checks the identity and the profile are present, and hands them to the later steps. lock ends the job.
    • Nothing secret is in the repository or on GitHub, and nothing is printed.
  • packaging/macos/package.sh:
    • The app is signed with the hardened runtime and must still run (--version).
    • The app is notarized and stapled first, so the self-update zip and the .dmg both carry it stapled.
    • Then the .dmg is signed, notarized and stapled.
    • The script ends with spctl on both. Ad hoc as before when MACOS_SIGN_IDENTITY is empty.
  • packaging/macos/notarize.sh submits with --wait, prints Apple's log on rejection, and staples .app and .dmg files.
  • release.yml (macOS):
    • horizon-client, horizon-ctl and horizon-prepare are signed right after the build, so the startup checks and the 1500-frame smoke run use the hardened binaries.
    • The zip is notarized. Bare programs can't be stapled.
  • launcher.yml (macOS): unlocks the keychain before Package and locks it again whatever happens.
  • Self-update: the launcher verifies the downloaded bundle's signature (codesign --verify --deep --strict) before swapping it in, and again where it lands. If it doesn't hold, the old app is put back. A new test covers a bundle tampered with after signing.
  • packaging/macos/README.md: signing, notarization and the keychain setup.

Unchanged: runs-on (vars.MAC_RUNNER), every publish step, the triggers and permissions. Dry runs (gh workflow run release|launcher --ref <branch>) still publish nothing. No entitlements are needed.

Switch: the repository variable MACOS_SIGN_IDENTITY. Main's workflows don't read it yet, so setting it changes nothing until this merges. Empty (forks) means ad hoc.

Status: draft until the proofs are in.

  • The notary profile is stored in the signing keychain and validated (notarytool history).
  • Launcher clippy and tests on the Mac mini, including the tampered-bundle case.
  • The identity in the signing keychain: needs a one-time export by Ludovic on the Mac mini (README, step 2).
  • A local signed and notarized build: spctl -a -vv on the .app, spctl -a -t open --context context:primary-signature -vv on the .dmg, stapler validate.
  • Dry runs of release.yml and launcher.yml on this branch, signing inside the horizon-release runner's job, and their artifacts verified the same way.

Merged inert (agent, 2026-10-21)

Rebased on main 1225f89e. Ludovic's Developer ID and notary setup don't exist yet: no MACOS_SIGN_IDENTITY variable, and the only secret is the release environment's RELEASE_SIGNING_KEY. Without the variable this changes nothing in the pipelines:

  • Every new workflow step (keychain unlock/lock, Developer ID signing, notarization) is if: … && vars.MACOS_SIGN_IDENTITY != '', so it is skipped. The rebase keeps main's horizon-server build, the server archive, the sign job (SHA256SUMS.sig), verify and the beta → stable promotion untouched; the signing loops now include horizon-server, which main ships in the macOS folder. Only the macOS jobs' timeout goes from 40 to 60 minutes. actionlint reports only the two warnings main already has.
  • package.sh unsigned: still ad hoc, plus a --version run of the packaged app. Ran locally: app valid, horizon-launcher 0.1.5, .dmg verified. A launcher dry run on this branch (run 39580224902, before the release freeze) passed on all three platforms with the signing steps skipped and published nothing.
  • Self-update now also checks codesign --verify --deep --strict on the new bundle. Today's ad hoc release bundles pass it: launcher-v0.16.0's Horizon.app, unzipped, is "valid on disk" and "satisfies its Designated Requirement". an_app_bundle_updates_in_place covers an ad hoc bundle through the launcher's own unpack, plus the tampered case. Launcher tests (75 + 12 + 1), clippy -D warnings and fmt pass on the Mac mini.

Still needs Ludovic (in FEATURES.md LATER): export the Developer ID identity into the signing keychain (README step 2), create the 1Password item "Horizon signing keychain", set MACOS_SIGN_IDENTITY, then one signed dry run of both workflows.

🤖 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/213 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/macos-signing` --- ### 📝 Commits (1) - [`3ffbb1c`](https://github.com/horizon-rust/horizon/commit/3ffbb1cb9fb0c84a3c5dc2adb44738d8621ba2b6) Sign and notarize the macOS builds with Developer ID ### 📊 Changes **7 files changed** (+314 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/launcher.yml` (+17 -2) 📝 `.github/workflows/release.yml` (+32 -2) 📝 `launcher/src/backend.rs` (+40 -2) 📝 `packaging/macos/README.md` (+64 -14) ➕ `packaging/macos/keychain.sh` (+99 -0) ➕ `packaging/macos/notarize.sh` (+37 -0) 📝 `packaging/macos/package.sh` (+25 -5) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Signs the macOS launcher (Horizon.app and the .dmg) and the game's programs with Ludovic's Developer ID, with the hardened runtime and a secure timestamp, then notarizes them and staples the ticket where one can be held. **What changes** - `packaging/macos/keychain.sh` manages a keychain of the Mac mini's own, `horizon-signing.keychain-db`. - It holds only "Developer ID Application: Ludovic Marie (YYJU63HSD4)", Apple's G1 intermediate and the notarytool profile `horizon-notary` (the Agents vault's App Store Connect team key). - The release runner's jobs run in their own security session, where the login keychain is locked, so it can't sign from there. `unlock` reads this keychain's password from 1Password (item "Horizon signing keychain"), unlocks it, checks the identity and the profile are present, and hands them to the later steps. `lock` ends the job. - Nothing secret is in the repository or on GitHub, and nothing is printed. - `packaging/macos/package.sh`: - The app is signed with the hardened runtime and must still run (`--version`). - The app is notarized and stapled first, so the self-update zip and the .dmg both carry it stapled. - Then the .dmg is signed, notarized and stapled. - The script ends with `spctl` on both. Ad hoc as before when `MACOS_SIGN_IDENTITY` is empty. - `packaging/macos/notarize.sh` submits with `--wait`, prints Apple's log on rejection, and staples .app and .dmg files. - `release.yml` (macOS): - `horizon-client`, `horizon-ctl` and `horizon-prepare` are signed right after the build, so the startup checks and the 1500-frame smoke run use the hardened binaries. - The zip is notarized. Bare programs can't be stapled. - `launcher.yml` (macOS): unlocks the keychain before Package and locks it again whatever happens. - Self-update: the launcher verifies the downloaded bundle's signature (`codesign --verify --deep --strict`) before swapping it in, and again where it lands. If it doesn't hold, the old app is put back. A new test covers a bundle tampered with after signing. - `packaging/macos/README.md`: signing, notarization and the keychain setup. **Unchanged:** `runs-on` (`vars.MAC_RUNNER`), every publish step, the triggers and permissions. Dry runs (`gh workflow run release|launcher --ref <branch>`) still publish nothing. No entitlements are needed. **Switch:** the repository variable `MACOS_SIGN_IDENTITY`. Main's workflows don't read it yet, so setting it changes nothing until this merges. Empty (forks) means ad hoc. **Status:** draft until the proofs are in. - [x] The notary profile is stored in the signing keychain and validated (`notarytool history`). - [x] Launcher clippy and tests on the Mac mini, including the tampered-bundle case. - [ ] The identity in the signing keychain: needs a one-time export by Ludovic on the Mac mini (README, step 2). - [ ] A local signed and notarized build: `spctl -a -vv` on the .app, `spctl -a -t open --context context:primary-signature -vv` on the .dmg, `stapler validate`. - [ ] Dry runs of release.yml and launcher.yml on this branch, signing inside the `horizon-release` runner's job, and their artifacts verified the same way. ## Merged inert (agent, 2026-10-21) Rebased on main 1225f89e. Ludovic's Developer ID and notary setup don't exist yet: no `MACOS_SIGN_IDENTITY` variable, and the only secret is the `release` environment's `RELEASE_SIGNING_KEY`. Without the variable this changes nothing in the pipelines: - Every new workflow step (keychain unlock/lock, Developer ID signing, notarization) is `if: … && vars.MACOS_SIGN_IDENTITY != ''`, so it is skipped. The rebase keeps main's horizon-server build, the server archive, the `sign` job (SHA256SUMS.sig), verify and the beta → stable promotion untouched; the signing loops now include `horizon-server`, which main ships in the macOS folder. Only the macOS jobs' timeout goes from 40 to 60 minutes. actionlint reports only the two warnings main already has. - `package.sh` unsigned: still ad hoc, plus a `--version` run of the packaged app. Ran locally: app valid, `horizon-launcher 0.1.5`, .dmg verified. A launcher dry run on this branch (run 39580224902, before the release freeze) passed on all three platforms with the signing steps skipped and published nothing. - Self-update now also checks `codesign --verify --deep --strict` on the new bundle. Today's ad hoc release bundles pass it: launcher-v0.16.0's `Horizon.app`, unzipped, is "valid on disk" and "satisfies its Designated Requirement". `an_app_bundle_updates_in_place` covers an ad hoc bundle through the launcher's own unpack, plus the tampered case. Launcher tests (75 + 12 + 1), clippy `-D warnings` and fmt pass on the Mac mini. Still needs Ludovic (in FEATURES.md LATER): export the Developer ID identity into the signing keychain (README step 2), create the 1Password item "Horizon signing keychain", set `MACOS_SIGN_IDENTITY`, then one signed dry run of both workflows. 🤖 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-02 15:55:50 +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#2410
No description provided.