Skip to content

Add script to build and publish the Darwin Swift SDK to GHCR#7059

Draft
JayShortway wants to merge 1 commit into
mainfrom
cursor/add-darwin-sdk-publish-script-7f9e
Draft

Add script to build and publish the Darwin Swift SDK to GHCR#7059
JayShortway wants to merge 1 commit into
mainfrom
cursor/add-darwin-sdk-publish-script-7f9e

Conversation

@JayShortway

Copy link
Copy Markdown
Member

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-android and hybrids

Motivation

To cross-compile RevenueCat/RevenueCatUI for Apple platforms from Linux (e.g. Cursor cloud agents) via xtool, we need a Darwin Swift SDK extracted from Xcode. Since Xcode can't be redistributed and downloading it requires interactive Apple auth, this provides a maintainer-run script to produce that SDK once and publish it privately for reuse.

Description

Adds scripts/build-darwin-sdk.sh, which:

  • resolves an Xcode source (an already-installed Xcode.app, a provided .xip, or a version downloaded via xcodes using a pre-generated FASTLANE_SESSION to avoid interactive 2FA),
  • runs xtool sdk build to extract a redistributable Darwin Swift SDK .artifactbundle (target host arch configurable; defaults to x86_64 to match cloud agents),
  • packages it as a gzipped tarball and pushes it to GHCR as an OCI artifact via oras, with version/arch/checksum annotations.

The script header documents how to consume the artifact in a .cursor environment Dockerfile (public base image + a RUN --mount=type=secret step + swift sdk install), which is the Cursor-supported pattern — a private FROM base image is intentionally avoided since Cursor's builder has no documented way to authenticate a private base-image pull.

Validated with shellcheck (clean) and by exercising the argument-validation and dependency-check paths. The end-to-end build/push path requires Xcode + oras and was not run in CI.

Open in Web Open in Cursor 

Co-authored-by: JayShortway <JayShortway@users.noreply.github.com>
@RevenueCat-Danger-Bot

Copy link
Copy Markdown
1 Error
🚫 Label the PR using one of the change type labels. If you are not sure which label to use, choose pr:other.
Label Description
pr:feat A new feature. Use along with pr:breaking to force a major release.
pr:fix A bug fix. Use along with pr:force_minor to force a minor release.
pr:other Other changes. Catch-all for anything that doesn't fit the above categories. Releases that only contain this label will not be released. Use along with pr:force_patch, or pr:force_minor to force a patch or minor release.
pr:RevenueCatUI Use along any other tag to mark a PR that only contains RevenueCatUI changes
pr:next_release Preparing a new release
pr:dependencies Updating a dependency
pr:phc_dependencies Updating purchases-hybrid-common dependency
pr:changelog_ignore The PR will not be included in the changelog. This label doesn't determine the type of bump of the version and must be combined with pr:feat, pr:fix or pr:other.

Generated by 🚫 Danger

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.

3 participants