Skip to content

Latest commit

 

History

History
124 lines (96 loc) · 10.2 KB

CI.md

File metadata and controls

124 lines (96 loc) · 10.2 KB

GitHub Actions

Pull requests and main

The build workflows use GitHub's Apple Silicon xcode-27 runner and pin Xcode 27.1, which includes the iOS 27.1 SDK required by the Duo hinge and control rail APIs. Runtime availability checks preserve the app's older deployment targets; they do not make those APIs compile with an older SDK. See the runner's installed Xcode versions.

ci.yml runs the synthetic core tests with swift test and compiles the iOS app in Release mode with signing disabled. This catches SDK compatibility errors before the distribution workflow needs signing credentials. Full Mac builds remain available through the local build scripts. CI needs no Apple credentials and boots no simulator.

The workflow has only contents: read, does not persist Git credentials, and receives no signing secrets. There is no privileged pull_request_target or workflow_run path, shared build cache, or artifact handoff into signing. Fork changes therefore cannot enter the distribution job through a cached build or a PR artifact.

TestFlight

Create a GitHub environment named testflight. Set deployment branch rules to selected branches, allowing only main, and disallow tag deployment. Add required reviewers if your maintainer setup supports an independent reviewer. Keep distribution credentials in this environment, not repository-wide secrets. Restrict who can push or merge to main using repository rules appropriate to your team.

Environment variables:

Variable Value
APPLE_BUNDLE_ID Registered product bundle identifier
APPLE_TEAM_ID Apple developer team
KEYCHAIN_SERVICE Optional existing session service; defaults to bundle ID plus .session

Environment secrets:

Secret Value
DISTRIBUTION_P12_BASE64 Base64-encoded Apple Distribution certificate and its private key; for Mac uploads, also include the Mac Installer Distribution certificate and private key in this P12
DISTRIBUTION_P12_PASSWORD P12 password; may be empty for a passwordless P12
IOS_PROFILE_BASE64 Base64-encoded, unexpired, manually managed App Store profile matching the bundle, team, and distribution certificate
MAC_PROFILE_BASE64 Base64-encoded manually managed Mac App Store distribution profile for the same bundle and team, with TestFlight enabled
ASC_PRIVATE_KEY App Store Connect API .p8 contents
ASC_KEY_ID That API key's ID
ASC_ISSUER_ID That API key's issuer

Use the narrowest Apple role that supports your upload/provisioning flow. Do not reuse a personal development private key for CI or commit these files. The workflow is intentionally not runnable until its distribution credentials are configured.

Create the distribution profile in Certificates, Identifiers & Profiles or through the App Store Connect API. Profiles generated by Xcode automatic signing cannot be used for this manual CI archive. Profiles are installed in ~/Library/Developer/Xcode/UserData/Provisioning Profiles, the current Xcode profile directory. Mac export selects the archive’s app identity and the exact installer identity for its team separately. The build scripts apply the manual signing style, distribution identity, and profile only to the app target; Swift package resource bundles receive no provisioning profile or distribution identity override.

From Actions, dispatch TestFlight on main, selecting ios or macos and supplying a new build number and the marketing version. The workflow checks out that exact commit, validates inputs, runs tests, installs signing credentials into a temporary keychain, archives the selected native app, and uploads directly to Apple. The profile is checked for team, exact app ID, expiry, and App Store distribution type before installation. The key import authorizes Apple’s codesign, security, productbuild, and productsign tools so installer signing cannot wait on an interactive Keychain approval. An always-run cleanup restores the keychain search list and removes the temporary keychain, profile, P12, and API key. A terminated hosted runner is discarded by GitHub.

The workflow never downloads or signs a PR artifact and never uploads signing materials or signed app archives as GitHub artifacts. After Apple processes the upload, complete compliance and assign the build to your internal group in App Store Connect. This does not publish an App Store release or automatically invite testers.

Local archive/upload remains available through scripts/testflight.sh; the CI helper refuses to run outside GitHub Actions. For local use, authenticate in Xcode or pass API authentication paths through the environment.

Updating dependencies

Actions are pinned to full commit SHAs and updated manually. Dependabot updates and CodeRabbit automatic reviews and replies are disabled for this repository. Xcode's Swift package lockfile records exact dependency revisions. Review workflow and dependency changes before merging them into the signing branch.

This separation follows the trust boundary used by T3 Code's macOS preview workflows. Slipstream's Swift build is small enough to rebuild trusted main directly, so it does not need T3 Code's two-stage PR artifact packaging system.

References: GitHub Actions secure use, deployment environments, and Apple signing on hosted runners.

Preview releases

Dispatch Preview release on main with a marketing version (X.Y.Z) and a positive build number unused on both Apple platforms. One dispatch tests and builds both apps from that exact commit, signs and notarizes the Mac download, archives and uploads both iOS and macOS to App Store Connect for TestFlight, then publishes vX.Y.Z-preview.N as a GitHub prerelease (never the latest stable release). The same version/build number is used everywhere. Existing tags are rejected; choose a fresh build number for each attempt.

Assets are Slipstream-vX.Y.Z-preview.N-altstore.ipa, Slipstream-vX.Y.Z-preview.N-macOS.zip, and changelog.md. The notes and Markdown asset include every commit since the most recently published nondraft GitHub release, including earlier previews. The first release includes all history. The workflow fails if the previous release tag is missing or is not an ancestor of the selected commit, rather than silently producing incomplete notes.

Each platform is compiled exactly once as a signed App Store archive. The IPA is a copy of the archived iOS app, with signatures and embedded profiles removed from the packaging copy. AltStore must sign it using the installer's Apple identity. It is not an App Store export encrypted with FairPlay. The Mac ZIP contains a universal Apple Silicon/Intel app signed with Developer ID Application, notarized by Apple, and stapled before the final ZIP is created. Signature verification, accepted notarization, ticket validation, and Gatekeeper assessment must all succeed before publication. Each native matrix job reads signing secrets directly from the protected environment, archives its platform once, makes a preview copy, and uploads that same original archive to Apple. The Mac copy is re-signed with Developer ID after removing its App Store profile; the original archive retains its App Store signature. Both Apple uploads and all preview packaging must succeed before the GitHub prerelease is published. Each platform has its own temporary signing keychain, profile, and cleanup on an isolated runner. Uploads to the same Apple platform are serialized with standalone TestFlight runs.

Apple uploads cannot be rolled back as a single transaction. If one upload fails, the other may already be in App Store Connect; no GitHub release is published. Use a fresh build number when retrying. Apple processing, tester-group assignment, and beta review still apply after successful uploads. This does not submit a public App Store release. The standalone TestFlight workflow remains available for uploading only one platform.

Both platform jobs use the main-only testflight environment, its App Store Connect key and team variable, and the distribution P12 and platform profiles documented above. Add DEVELOPER_ID_P12_BASE64 (Developer ID Application certificate and private key) and DEVELOPER_ID_P12_PASSWORD. This is a different identity from Apple Distribution and Mac Installer Distribution; neither of those can sign a direct-download app. The API key must have access to notarization. The temporary credential helper switches the Mac runner from App Store credentials to this identity without requiring a Developer ID provisioning profile, and always cleans it up, including on notarization failure. Missing credentials or notarization rejection fail the release; there is no unsigned fallback.

Build artifacts contain only the packages and changelog. A separate Linux job gets contents: write to create the release; the native jobs have read tokens and receive signing secrets only in credential-install steps. No PR artifacts feed this path. To package an existing signed archive locally, use its matching version/build number:

CI=true APP_VERSION=0.1.0 BUILD_NUMBER=1 SLIPSTREAM_BUNDLE_ID=cc.pixp.Slipstream \
  ./scripts/preview-release.sh ios

Output is under ignored build-preview/v0.1.0-preview.1/; use a fresh build number or remove your previous disposable output before packaging it again. Run preview-release.sh macos to copy the Mac archive, then scripts/sign-mac-preview.sh with the same version/build, APPLE_TEAM_ID, a locally installed Developer ID Application identity, and the three App Store Connect authentication variables from Configuration.md. The Mac copy is not ready for direct distribution until the signing/notarization command succeeds. Neither packaging command compiles the app. AltStore install and Apple processing still need real-device verification.