iOS TestFlight CI/CD + fix Release-archive build (DEBUG-gating from #5079)
Adds GitHub Actions CI/CD that ships the cmux iOS app to TestFlight, and fixes the iOS Release-archive build regression that building it in Release exposed.
TestFlight workflow (.github/workflows/ios-testflight.yml)
- Triggers:
workflow_dispatch(optionalbuild_number/force) + a nightly cron that skips whenmainhas had no new commits in the last 24h (a cheap ubuntudecidejob), so it doesn't burn build numbers on unchanged code. - Build:
macos-26, Xcode select +submodules: recursive+install-zig-ci.sh+ensure-ghosttykit.sh(mirrorstest-ios.yml), thenios/scripts/upload-testflight.sh --lane beta --signing automatic(bundle iddev.cmux.app.beta, internal TestFlight). - Signing: cloud-managed (automatic) via
-allowProvisioningUpdates+ the App Store Connect API key, so the runner needs no iOS distribution cert/profile in its keychain — only the three ASC secrets (ASC_API_KEY_ID,ASC_API_ISSUER_ID,ASC_API_KEY_P8_BASE64).upload-testflight.shgains a--signing manual|automaticflag (defaultmanual, preserving local-keychain exports).
Validated end-to-end on the branch (temp push trigger, since removed): real archive → cloud-signed export → altool UPLOAD SUCCEEDED with no errors, Delivery UUID 39be114b-d1df-4392-8dcb-32f9708f3f16, ~3.5 min.
iOS Release-archive fix (⚠️ this was also breaking main's nightly/release iOS)
test-ios.yml only builds Debug/simulator, so two DEBUG-only-used-from-non-DEBUG leaks from the #5079 iOS-mobile merge went unnoticed and broke the Release archive:
GhosttySurfaceView.surfaceTextwas#if DEBUGbut the non-DEBUG publicvisibleTerminalSnapshot()(Copy Debug Logs, ships in betas) calls it → un-gated the helper.TerminalLayoutPreviewView(UITest screenshot scaffolding, mounted only whenCMUX_UITEST_TERMINAL_PREVIEW=1) was gated only by#if canImport(UIKit)and called DEBUG-onlydebug*ForLayoutPreviewseams → DEBUG-gated the file + its CMUXMobileRootView mount points.
cmux-ios now compiles in Release (verified BUILD SUCCEEDED + the real upload above). Debug behavior is unchanged.
Notes
- The
ios-testflightworkflow doesn't run on PRs (dispatch + nightly only); it's validated above. - The Release-archive fix is bundled here because building iOS in Release is exactly what this PR adds, but it independently unbreaks main's nightly/release iOS — worth merging promptly.
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.
[!NOTE]
Medium Risk
Touches release signing/export and CI secrets for App Store Connect; Swift changes are compile-gating only with no intended runtime behavior change in Release beyond fixing the broken archive.
Overview
Adds automated TestFlight delivery for the iOS beta (dev.cmux.app.beta) via a new GitHub Actions workflow: manual dispatch or a nightly cron, with a lightweight decide job that skips scheduled uploads when main has no commits in the last 24h. The macOS job provisions GhosttyKit, materializes App Store Connect API keys, and runs upload-testflight.sh with --signing automatic so CI can export without a distribution cert in the keychain.
upload-testflight.sh gains --signing manual|automatic (default manual): automatic export omits manual cert/profile plist entries and relies on cloud-managed signing with -allowProvisioningUpdates.
Release archive fixes exposed by shipping Release builds: GhosttySurfaceView.surfaceText is no longer #if DEBUG-only so release Copy Debug Logs / visibleTerminalSnapshot() compiles; UITest terminal layout preview (TerminalLayoutPreviewView and its mount in CMUXMobileRootView) is restricted to DEBUG so Release does not pull DEBUG-only preview seams.
Reviewed by Cursor Bugbot for commit 458d1001bc1aaaef86039a1c9ff195d352e2951f. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Automates TestFlight uploads for the cmux iOS beta and fixes Release-archive failures from DEBUG-only code. Manual and nightly uploads use cloud-managed signing; nightly skips only when the current main HEAD was already uploaded. Release/TestFlight builds compile again.
-
New Features
- Added
iOS TestFlight (beta)workflow at.github/workflows/ios-testflight.ymlto archive, export, and upload thebetalane (dev.cmux.app.beta). - Triggers: manual (
workflow_dispatchwith optionalbuild_number) and nightly; gate uses the last successful run’shead_shaso missed/failed runs retry. Addsactions: readto query run history. - Uses cloud-managed signing via App Store Connect; requires
ASC_API_KEY_ID,ASC_API_ISSUER_ID,ASC_API_KEY_P8_BASE64. No distribution cert/profile on the runner. ios/scripts/upload-testflight.shsupports--signing automatic(CI) in addition tomanual(default).- Labeled jobs with human-readable names for clearer Actions UI.
- Added
-
Bug Fixes
- Ungated
GhosttySurfaceView.surfaceTextsovisibleTerminalSnapshot()works in Release; fixes Release/TestFlight archive failures. - DEBUG-gated
TerminalLayoutPreviewViewand its mounts inCMUXMobileRootViewto avoid DEBUG-only seams in Release. cmux-iosnow compiles in Release; nightly/release iOS and TestFlight builds succeed.
- Ungated
Summary by CodeRabbit
-
New Features
- Added an iOS TestFlight CI pipeline to automate conditional beta uploads with manual trigger and nightly scheduling.
-
Improvements
- Terminal layout preview is now enabled only in debug iOS builds.
- Terminal snapshot / “copy logs” functionality remains available in release builds for diagnostics.
- TestFlight upload tooling now supports selectable signing modes (manual or automatic) for exports.