feat: release server before macos build#1075
Conversation
|
Claude (@claude) review |
|
Greptile (@greptileai) review |
|
Claude finished Nikhil (@shadowfax92)'s task in 2m 0s —— View job Code Review
Overall this is a well-structured refactor. The Medium — No timeout on
|
✅ Tests passed — 1059/1064
|
Greptile SummaryThis PR makes the server release workflow reusable (
Confidence Score: 4/5Safe to merge for repos whose default branch is named main; the hardcoded branch check in release-server.yml warrants a minor follow-up. The job-dependency and condition logic is correctly wired: scheduled runs always release the server first, dispatch builds can opt out, and the macOS build is blocked when the server release fails. The one inconsistency is that release-server.yml hardcodes refs/heads/main while the nightly workflow dynamically reads DEFAULT_BRANCH — if those ever diverge, the server release job would silently return success without actually uploading, and the macOS build would proceed with stale R2 artifacts. .github/workflows/release-server.yml — the if: github.ref == refs/heads/main on the release job is worth hardening to match the dynamic branch logic in the caller. Important Files Changed
Sequence DiagramsequenceDiagram
participant Trigger as Trigger (schedule / dispatch)
participant RI as resolve_inputs
participant AM as authorize_manual_dispatch
participant RS as release_server (workflow_call)
participant B as build (macOS)
participant R2 as Cloudflare R2
Trigger->>RI: start (ubuntu-latest)
Trigger->>AM: start (macOS, dispatch only)
RI->>RI: resolve target_ref, bump_mode, release_server
RI->>RI: git checkout target_ref
RI->>RI: read server version from package.json
alt "release_server == true AND target_ref == DEFAULT_BRANCH"
RI-->>RS: outputs (server_version)
AM-->>RS: result (schedule: skipped, dispatch: success)
RS->>RS: validate version matches package.json
RS->>RS: "bun run build:server (NODE_ENV=production)"
RS->>R2: upload server artifacts
RS->>RS: create GitHub release + tag
RS-->>B: "result == success"
else "release_server == false"
RI-->>B: "result == success (release_server skipped)"
end
RI-->>B: outputs (target_ref, bump_mode, commit_version, upload_to_r2)
AM-->>B: result
B->>B: sync repo to target_ref
B->>B: bump version
B->>B: build BrowserOS (macOS arm64)
B->>R2: "upload DMG (if upload_to_r2 == true)"
|
Greptile SummaryThis PR gates the nightly macOS build on a successful server release by extracting a reusable
Confidence Score: 3/5The workflow orchestration logic is generally correct, but two failure scenarios could silently break the automated nightly before anyone notices. The new .github/workflows/nightly-macos-build.yml (scheduled-run guard logic) and .github/workflows/release-server.yml (environment protection interaction) Important Files Changed
Sequence DiagramsequenceDiagram
participant Scheduler as GitHub Scheduler / Dispatch
participant RI as resolve_inputs<br/>(ubuntu-latest)
participant AMD as authorize_manual_dispatch<br/>(macOS self-hosted)
participant RS as release_server<br/>(reusable: release-server.yml)
participant Build as build<br/>(macOS self-hosted)
Scheduler->>RI: trigger (schedule or workflow_dispatch)
RI->>RI: resolve target_ref, bump_mode, release_server, upload_to_r2
RI->>RI: "guard: release_server=true only on DEFAULT_BRANCH"
RI->>RI: checkout target_ref
RI->>RI: read server package.json → server_version
alt workflow_dispatch
Scheduler->>AMD: trigger (environment: release-core)
AMD-->>Build: authorize
end
alt "release_server == 'true'"
RI-->>RS: pass server_version
RS->>RS: validate version vs package.json
RS->>RS: bun run build:server (+ R2 upload)
RS->>RS: verify artifacts
RS->>RS: generate release notes
RS->>RS: create GitHub release / tag
RS-->>Build: success gate
end
Build->>Build: sync repo to target_ref
Build->>Build: bump version
Build->>Build: build BrowserOS (macOS arm64)
Build->>Build: upload DMG artifact
|
Summary
Design
The nightly workflow resolves the target ref and server package version, calls the reusable server release workflow before packaging, and only starts the macOS build after that upload succeeds. Manual branch builds must disable server release rather than publishing non-default-branch artifacts to global R2 latest.
Test plan