Repository navigation
build: CocoaPods and SwiftPM - #58
Merged
Merged
Conversation
The podspec could not have been pushed to CocoaPods trunk as it stood. `pod lib lint` reported two hard errors and a warning: - `source_files` matched zero files. It read `ios/Sources/AppductCore/...` while the podspec sat *in* `packages/native/ios/`, resolving to a doubled `ios/ios/` path. For a trunk pod it is worse than a typo: CocoaPods clones `s.source` and resolves file patterns against the root of the cloned repository, not the podspec's own directory. - `s.source` carried no `:tag`, so there was no revision to clone. - No license file was reachable from the pod root. Move the podspec to the repo root, next to Package.swift, which is there for the identical reason. Paths are now spelled from the root, which is both what trunk resolves against and what `pod lib lint` checks in place, so the two agree. Also raise `swift_version` from '5.9' to '6.0'. `-swift-version` accepts only 4, 4.2, 5 and 6, so '5.9' was never passed through verbatim -- Xcode normalised it down to mode 5, quietly building the pod under laxer rules than SwiftPM, which compiles these same sources at `-swift-version 6`. Verified: `pod lib lint --platforms=ios` passes, building both the pod and its test spec.
`deploy.yaml` published the three npm packages and nothing else, so the
iOS artifacts had to be pushed by hand. Add a `publish-cocoapods` job.
SwiftPM needed no work: it releases off the git tag, which a published
GitHub release already guarantees is on the remote. What that did need was
a guard -- `pod trunk push` clones `s.source` at `tag: v#{version}` rather
than uploading the working tree, and a tag missing from the remote fails
deep inside CocoaPods' downloader with an opaque git error. The job checks
that precondition up front, where the message can say what is wrong.
The job runs last, after every npm publish has succeeded. A trunk version
is permanent -- there is no `pod trunk` unpublish and a version can never
be reused -- while `npm unpublish` works for 72 hours, so the irreversible
half of a release only runs once the reversible half is known good. It is
also re-run safe: it queries the trunk API and skips a version already
published, so re-running a partially-failed deploy does not fail on a
duplicate push.
Needs a COCOAPODS_TRUNK_TOKEN secret in a `cocoapods` environment;
CocoaPods has no OIDC equivalent to npm's trusted publishing.
`--allow-warnings` is required for now, tracked in #57.
The install snippets pointed at 0.8.0, which predates the root Package.swift -- no tag at or below it has a Swift manifest, so the documented line could not resolve. 0.9.0 is the first release that carries one. Note in passing that `from:` is a floor rather than a pin: SwiftPM's `.upToNextMajor` keys on the major component alone, so this accepts every later 0.x release and needs no edit per release.
#59 fixed the three strict-concurrency warnings that forced the flag, and added an iOS-destination build to test.yaml with warnings-as-errors. With that gate in place a new warning fails on the PR that introduces it, so trunk validation can be strict here without turning a release into the first place anyone finds out. Verified: `pod lib lint AppductCore.podspec --platforms=ios` passes on this branch with no --allow-warnings. Note the iOS gate does not cover tvOS, which the podspec also declares and trunk also validates.
V3RON
force-pushed
the
claude/appduct-package-publishing-7514be
branch
from
September 16, 2026 07:29
7ee520c to
a81976e
Compare
Contributor
Author
|
Rebased onto That flag was the one thing keeping trunk validation from being a real gate. It is now safe to remove because #59 added an iOS-destination build to Re-verified on the rebased branch: Still unverified: tvOS. The podspec declares it and trunk validates it, but the new CI gate covers iOS only and this machine has no tvOS simulator runtime. |
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.
Makes
AppductCorepublishable to CocoaPods and SwiftPM, and automates both on release. Maven Central is untouched and remains an ops task.Why
Three of the four documented native install paths did not work:
0.8.0, which predates the rootPackage.swift— no tag at or below it has a manifest0.9.0; publishing is the release tag, already automaticThe podspec was broken
pod lib lintgave two hard errors. The interesting one:source_filesreadios/Sources/AppductCore/...while the podspec sat inpackages/native/ios/, resolving to a doubledios/ios/path that matched zero files. For a trunk pod that is worse than a typo — CocoaPods cloness.sourceand resolves file patterns against the root of the cloned repository, not the podspec's directory, so the paths had to be root-relative either way.Hence the move to the repo root, next to
Package.swift, which lives there for the identical reason.s.sourcealso had no:tag(nothing to clone) and no reachable license file.Also raises
swift_versionfrom'5.9'to'6.0'.-swift-versionaccepts only4,4.2,5and6, so'5.9'never reached the compiler verbatim — Xcode normalised it down to mode 5, quietly building the pod under laxer rules than SwiftPM, which compiles the same sources at-swift-version 6(confirmed from the compile line).The new job
publish-cocoapodsruns last, after every npm publish has succeeded. A trunk version is permanent — nopod trunkunpublish, and a version can never be reused — whereasnpm unpublishworks for 72 hours. So the irreversible half of a release only runs once the reversible half is known good.It is re-run safe (queries the trunk API, skips a version already published) and verifies the release tag is fetchable before pushing, since
pod trunk pushclones the tag rather than uploading the working tree.SwiftPM needed no publishing step: it releases off the git tag, which a published GitHub release already guarantees is on the remote.
Verification
pod lib lint AppductCore.podspec --platforms=ios— passes, building the pod and its test spec, at both mode 5 and mode 6xcodebuild -scheme AppductCore -destination 'generic/platform=iOS'against the rootPackage.swift—** BUILD SUCCEEDED **, so the SPM install path this PR documents genuinely worksAppductCore@0.9.0→ 404/not-published,Alamofire@5.9.0→ published,Alamofire@99.0.0→ not publishedv0.8.0resolves,v0.9.0does not — exactly the case it exists to catchactionlintclean on the new job (the two SC2016 infos it reports are pre-existing onpackage)check:linkspasses across 39 filestvOS lint is unverified — the podspec declares
iosandtvosand trunk validates both, but this machine has no tvOS simulator runtime. GitHub's macOS images normally ship one; that is reasoning, not a measurement, and it is the likeliest way the job fails on its first real run.Before this can run
pod trunk registerand confirm by emailcocoapodsenvironment with aCOCOAPODS_TRUNK_TOKENsecretv0.9.0and cut the releaseFollow-ups
pod trunk push(drop--allow-warnings) #57 — three Swift warnings force--allow-warnings, so trunk validation is not yet a real gate. It also records thattest.yaml'sswift buildtargets macOS, where#if canImport(UIKit)is false, so CI has never compiled that code for iOS.core/core-noop:maven-publishis wired but there is no repository, signing, or credentials.