Skip to content

ci(release): publish server artifacts before desktop builds finish - #14

Merged
nixuuu merged 1 commit into
devfrom
ci/faster-releases
Nov 3, 2026
Merged

nixuuu merged 1 commit into
devfrom
ci/faster-releases

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 3, 2026

Copy link
Copy Markdown
Member

Nightly server artifacts (GHCR images, gateway/worker binaries, manifest.json/checksums.txt)
are published ~9–11 min after a merge instead of 38–44; desktop (macOS notarization)
publishes later without blocking the next run.

  • plan (semantic-release dry run) decides the version; binaries, images (cache only)
    and desktop build next to the checks.
  • release tags only after checks pass and only the planned version (verifyRelease guard,
    before tagging). A superseded or failed run stops its own builds (stop-builds).
  • Two-stage, idempotent publication (scripts/release-upload.ts): publish-server
    (binaries, checksums, manifest last, forward-only image aliases), then publish-desktop
    (installers, blockmaps, feeds, regenerated checksums/manifest). "Re-run failed jobs"
    adds a target that failed, e.g. macOS after a notarization failure.
  • Per-job concurrency instead of per-run; release CI checks no longer serialize.
  • Nightly builds desktop for linux-x64 + darwin-arm64 only (dispatch input
    desktop_all_targets for all); beta/stable build all targets.
  • Bun/Electron caches, shared setup action, docs/release.md updated.

Tests: bun test scripts/ (planned-version and superseded-run fixture, server→desktop
manifest consistency and re-runs), check:tmp, typecheck, gen:check, actionlint clean.
Needs confirmation on the first real runs (checklist in docs/release.md).

Plan the version with a semantic-release dry run and build binaries, images
and desktop next to the checks; tag, push and upload only after they pass,
refusing any version other than the planned one. Publish binaries, manifest
and image aliases first, desktop installers and feeds in a second idempotent
stage. Concurrency is per job instead of per run, superseded runs stop their
builds, and nightly skips the experimental desktop targets.
@nixuuu
nixuuu merged commit 02888a8 into dev Nov 3, 2026
2 checks passed
@nixuuu
nixuuu deleted the ci/faster-releases branch November 3, 2026 15:44
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 8, 2026
…374)

## Change

`v0.2.0-nightly.107` became public at 20:50:02 UTC, but its desktop
channel manifests arrived at 20:53:16. A scheduled update check during
that interval selected the previous version and waited another hour.

Keep releases as drafts while staging server binaries, desktop
installers, blockmaps, cumulative channel feeds, checksums and the final
manifest. Require the macOS arm64, Linux x64 and Windows x64 targets,
plus complete metadata for an included experimental Linux arm64 build.
Verify every uploaded file's state, size and SHA-256 through paginated
GitHub API reads before a single publication PATCH. Stable can become
latest at that point; beta/nightly cannot.

Semantic-release creates drafts and its GitHub `addChannel` hook is
disabled because that hook can publish directly despite `draftRelease`.
Beta/stable promotions rebuild their own versions through the same
publication barrier. Image aliases move afterward; back-merge and
hygiene depend on completed publication. Mobile still runs its separate
EAS/TestFlight/OTA pipeline after a successful Release.

Interrupted uploads resume the same draft and skip matching files.
Published releases are never clobbered on reruns, including a lost
publication response or a later image-alias failure. Shared
transient-read retries from #320 remain intact; exhausted reads fail
closed instead of being treated as a missing release.

Desktop polling stays unchanged: draft visibility removes the race for
existing clients without changing their saved check schedule. Server
updates and channel image aliases now wait for required desktop builds
too. Failed drafts remain available for retries and are excluded from
existing retention.

Related: #14
Related: #320

## Verification

- `bun install`
- `bun run gen:check`, `bun run typecheck`, `bun run lint`, `bun run
format:check`
- `bun test scripts/release.test.ts scripts/release-upload.test.ts`: 21
passed, covering channel visibility, promotion versions, missing
platforms/feeds/blockmaps, upload interruption, verification failures
and publication-response loss.
- `bun run check:tmp`: 1852 passed, 161 skipped, 0 failed across 328
files; no project files left in its private temp directory. Live tests
remained opt-in.
- `bun run --cwd apps/web build`; `mise exec [email protected]
[email protected] -- actionlint`

Release/promotion workflows were not dispatched. No GitHub releases or
tags were created or edited. Actual GitHub publication and platform
signing remain pipeline validation; local tests use isolated fixtures.
Polish release/update documentation describes the publication rule and
retry behavior.
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