Skip to content

feat(desktop): sign macos builds and ship beta/nightly apps - #2

Merged
nixuuu merged 1 commit into
devfrom
feat/desktop-signing-channels
Nov 3, 2026
Merged

nixuuu merged 1 commit into
devfrom
feat/desktop-signing-channels

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 3, 2026

Copy link
Copy Markdown
Member

The v0.1.0 macOS app was unsigned, so Gatekeeper reported it as "damaged" after download. This signs and notarizes macOS builds and splits the desktop app per release channel.

  • Signing: every Mach-O in the bundled runtime (gateway/worker/web sidecars, embedded PostgreSQL) is signed with hardened-runtime entitlements (JIT for Electron and Bun); notarization via App Store Connect API key or Apple ID, ticket stapled; ad-hoc signing when no certificate is configured. macOS CI verifies codesign, spctl and stapler.
  • Channels: "Canopy" (stable), "Canopy Beta", "Canopy Nightly" install side by side — own app id, user data, icon tint (beta amber, nightly violet) and artifact names; canopy:// stays with stable.
  • Auto-update: each app follows its own channel from GitHub Releases (on start and every 6 h), downloads in the background, offers "Restart to update", never downgrades; needs a signed build on macOS.
  • Docs: required secrets and Gatekeeper behaviour in docs/release.md / docs/desktop.md.

Verified on Linux: AppImage/deb of all three channels, startup under Xvfb, typecheck, gen:check, actionlint, web build, check:tmp 659 pass / 0 fail. Signing, notarization and installing an update must be confirmed on the first macOS CI run.

@nixuuu
nixuuu merged commit 03306e9 into dev Nov 3, 2026
2 checks passed
@nixuuu
nixuuu deleted the feat/desktop-signing-channels branch November 3, 2026 10:23
nixuuu added a commit that referenced this pull request Nov 4, 2026
The macOS desktop job has failed on every nightly since ~18:47 UTC, so
no macOS update was published for nightly.33+ (Linux desktop built
fine). Three causes, all fixed:

1. **Pairing assertion (run 41903293146):**
`runtime.integration.test.ts:178` expected `worker.json` to be
byte-identical after re-configuring, but initial pairing legitimately
races the worker's secure-route migration (endpoint, certificate pin,
fallback fields). The assertion (from #68) now checks enrollment
identity and data preservation; a separate unchanged-save check verifies
identical process IDs, config bytes and modification times.
2. **Stapling (runs 41905804716, 41890651151):** notarization succeeded
but `stapler` failed with error 68 (`NSURLErrorDomain -1005`, Apple
ticket lookup). The pinned `@electron/notarize` never invoked its retry
callback; a patch (`patches/@electron%[email protected]`) makes
staple + validate retry up to five times with 15/30/60/60 s backoff.
Notarization stays mandatory.
3. **Partial publication:** when only one desktop target succeeded,
`publish-desktop` rejected `download-artifact@v5`'s flat single-artifact
layout, so even the Linux feeds weren't published. The merger now
accepts it; multi-target merging and checksums unchanged.

Checks: install, gen:check, typecheck, lint, format:check, check:tmp
(1,051 pass, 147 skip, 0 fail), web/desktop and shell builds; packaged
Linux CI-path integration tests (11 pass). macOS signing, Apple ticket
delivery, stapling and Gatekeeper are confirmed by the next nightly run.

Fixes: #2
Fixes: #14
Fixes: #68
nixuuu added a commit that referenced this pull request Nov 4, 2026
Automatic promotion (#87) holds a linked change and everything merged
after it until the linking fix has soaked for 24 h. The first scheduled
run showed how much one link can hold back (#103's `Fixes: #2` held the
whole range since v0.1.0), so the convention now says when to link and
when not to.

- AGENTS.md, docs/contributing.md and the PR template: link only the PR
whose behaviour the fix actually corrects; no links from
`test`/`ci`/`docs`/`refactor`/`chore` commits or for pre-existing
behaviour; use `Related: #N` (not parsed, holds nothing) for context.

No code change; the parser already ignores `Related:`.
nixuuu added a commit that referenced this pull request Nov 5, 2026
The desktop app now keeps checking for updates after one has been
downloaded. If a newer build appears, it downloads and replaces the
staged one, so a restart installs the newest version.

**Before:** once an update was downloaded, the updater stopped looking:
- the periodic timer stopped;
- "Check now" in the popover skipped the app;
- the desktop updater refused to check in the `downloaded` phase.

A downloaded nightly.70 therefore stayed the target even after newer
nightlies came out.

**What electron-updater 6.8.3 does on a second check** (checked in the
pinned source):

| Platform | Behaviour |
|---|---|
| macOS | A newer ZIP replaces the cached ZIP and the proxy feed. With
`autoInstallOnAppQuit=false`, Squirrel downloads, validates and stages
it during `quitAndInstall`. |
| Windows / NSIS | Installs from the current download helper's installer
path. |
| Linux / AppImage | Installs from the current helper's AppImage. |
| Linux / deb | Updates stay disabled; the package manager owns
installation. |

The library clears its shared `pending` files when a replacement fails.
The fix therefore downloads into alternating cache directories, so the
older package stays installable.

**Behaviour now**
- **Checks:** the popover, Settings → App updates and the periodic timer
keep checking after a download. An unchanged feed keeps the staged
version.
- **A newer download:** the row shows the new target and its percentage.
It turns "Ready" only once the download is complete and finalized.
- **Restart:** still available; it waits for the current operation, then
installs the newest complete package.
- **A failed newer download:** the older version is Ready again, with
"Update failed. Check again to retry."
- **Remote updates:** a remote restart reports and records the version
actually installed.
- **Unchanged:** channel confirmation, downgrade and quit behaviour.

**Tests:** desktop updates tests with a fake updater:
- a newer build replaces the staged one;
- an unchanged feed keeps the staged one;
- a failed replacement leaves the older one installable;
- the timer keeps running after a download;
- restart installs what is staged.

Remote-update integration passes, including a replacement while waiting
for idle. Desktop tests: 74 passed. `check:tmp`: 1363 passed, 0 failed.

**Copy audit (§8):** separate Check and Restart actions, an explicit
waiting explanation, and an error that ends with an action. Checked in
light and dark, at desktop and phone width.

**Not verified:** a signed macOS build with Squirrel installation and
native restart.

Related: #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant