Skip to content

build(shared-core): publish the XCFramework to flipcash-shared-core-spm - #1294

Merged
bmc08gt merged 1 commit into
code/cashfrom
chore/publish-sharedcore
Aug 21, 2026
Merged

build(shared-core): publish the XCFramework to flipcash-shared-core-spm#1294
bmc08gt merged 1 commit into
code/cashfrom
chore/publish-sharedcore

Conversation

@bmc08gt

Copy link
Copy Markdown
Collaborator

Points the :kmp:shared-core KMMBridge publish at
code-payments/flipcash-shared-core-spm
so iOS can depend on a small public Swift Package instead of this repo.

Both halves move: gitHubReleaseArtifacts(repository = …) uploads the
SharedCore.xcframework.zip as a release asset there, and spm(spmDirectory = …)
writes the generated Package.swift into a checkout of it rather than this repo's
root (its default). version and the package directory now come from
-PsharedCoreVersion / -PspmRepoDir, with the directory falling back to the root
build dir so spmDevBuild has somewhere to write locally without dirtying the tree.

Adds Publish SharedCore, a workflow_dispatch lane that takes the version to cut.
It runs on macOS — Apple targets and swift package compute-checksum both need
Xcode, so it can't share the Ubuntu runners the rest of CI uses.

Two things worth knowing about the workflow:

  • It needs a PAT, not a deploy key. KMMBridge ships a setupDeployKeys helper,
    but a deploy key can only push git — it can't create the GitHub release the binary
    is uploaded to — and the job's own GITHUB_TOKEN can't reach another repository at
    all. One fine-grained PAT with Contents: read & write on the package repo covers
    both halves.
  • It force-moves the version tag. The release upload creates the tag against
    main as it was before the Package.swift commit exists. Left there, SPM would
    resolve the new version to the previous binary, so the last step re-tags onto the
    commit that actually references the new asset.

Before the first publish

Add SHARED_CORE_PUBLISH_TOKEN to this repo's Actions secrets: a fine-grained PAT
with Contents: read & write on code-payments/flipcash-shared-core-spm. The package
repo is already seeded and public, so consumers need no auth of their own.

The package, product, and framework are all named SharedCore regardless of the
repository name, so iOS consumes it as
.package(url: "https://github.com/code-payments/flipcash-shared-core-spm", from: "…")
and import SharedCore.

Point both halves of the KMMBridge publish at
code-payments/flipcash-shared-core-spm: the XCFramework zip is uploaded as a
release asset there, and the generated Package.swift is written into a checkout
of it rather than this repo's root. iOS then depends on a small public package
instead of the whole Android app.
Add the workflow that cuts a release: it builds on macOS (Apple targets and
`swift package compute-checksum` both need Xcode), runs kmmBridgePublish, then
commits Package.swift and moves the version tag onto that commit — the release
upload creates the tag against the previous state, so leaving it there would
resolve the version to the previous binary.
Publishing needs SHARED_CORE_PUBLISH_TOKEN: a fine-grained PAT with Contents:
read & write on the package repo. The job's own GITHUB_TOKEN cannot reach
another repository, and a deploy key can push git but cannot create the release
the binary is uploaded to.
@github-actionsgithub-actionsBot added the type: build Build system, Gradle, dependencies label Aug 21, 2026
@bmc08gt
bmc08gt merged commit c97fd61 into code/cashAug 21, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the chore/publish-sharedcore branch August 21, 2026 17:25
bmc08gt added a commit that referenced this pull request Aug 21, 2026
…esign
* origin/code/cash:
fix(core): add \ to escape ' in What's (#1298)
feat(shared-core): wrap the framework in a Swift target (#1297)
chore: update display name entry title/hint (#1296)
ci(shared-core): write a placeholder local.properties before publishing (#1295)
build(shared-core): publish the XCFramework to flipcash-shared-core-spm (#1294)
refactor(build-logic): extract the KMP test-fixture generator into a convention plugin (#1293)
build(base58): declare the base58 lint tasks' dependency on generated fixtures (#1292)
test(base58): run the vector gate on Kotlin/Native, not just the JVM (#1289)
build(codes): declare the kikcode lint tasks' dependency on generated fixtures (#1288)
# Conflicts:
#	apps/flipcash/core/src/main/res/values/strings.xml
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: buildBuild system, Gradle, dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@bmc08gt