Add iOS Swift Package publishing channel (optimization.swift)#292
Merged
Alex Freas (akfreas) merged 13 commits intoMay 29, 2026
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
33360e3 to
fc050b9
Compare
fc050b9 to
cc1f72e
Compare
Charles Hudson (phobetron)
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a publishing channel that ships the native Swift Package to a separate distribution repo,
contentful/optimization.swift, so consumers can add the SDK by URL (from: "x.y.z") like any other SwiftPM package — no monorepo clone, nopnpm install, no subdirectory tricks.Implements
IOS_SPM_PUBLISHING_PLAN.md(steps 2–5). The distribution repo is treated like an npmdist/: CI builds the package and pushes the built result; nobody commits to it by hand.Changes
@contentful/optimization-js-bridge, not hand-committed. This makes a stale bridge structurally impossible — it's rebuilt on every release/build.pnpm run ios:bridge/ios:build/ios:testbuild the bridge beforeswift build/swift test.README.md+LICENSEinpackages/ios/ContentfulOptimization/(these ship to the distribution repo; links are absolute and it carries a "generated; do not file PRs here" note).publish-spm.yaml— on eachv*release (orworkflow_dispatch), builds the bridge (stamping the version into the UMD), assembles the package payload, and pushes a commit + tag tooptimization.swiftover SSH using theSPM_MIRROR_DEPLOY_KEYActions secret (a writable deploy key provisioned byscripts/setup-spm-mirror-credential.sh).swift-package-buildjob (macOS) builds the bridge then runsswift build+swift teston PRs touching the package or the bridge. The existinge2e-ios-sdk-buildjob now also builds the bridge first (required since the UMD is no longer committed — SwiftPM silently ships an empty resource bundle for a missing.copyfile, which would break the app at runtime).ViewTrackingControllerresume-visibility assertion that didn't match the documented re-evaluate-on-resume behavior.packages/ios/README.mdand the packageAGENTS.md.Validation
main-pipelinegreen on this branch, includingSwift Package Build & Test,Build iOS UI Test Bundles, and bothE2E iOS UIschemes.swift testpasses 93/93.optimization-ios-demo) builds against the local SDK with the bridge regenerated by its pre-build step.Follow-ups (not in this PR)
SPM_MIRROR_DEPLOY_KEYsecret are already provisioned. After merge, the first dry run is aworkflow_dispatchofpublish-spm.yamlwith a throwaway tag (e.g.v0.0.1-alpha.1) —workflow_dispatchonly becomes available once this workflow is onmain.optimization.swiftis currentlyINTERNAL, sofrom:URL resolution will need auth (or the repo made public) before the demo can point at the URL instead of the local path.