chore: add a just release recipe that starts the Xcode Cloud build - #151
Merged
Conversation
The Xcode Cloud workflow used to start on any change to app/pubspec.yaml. That file carries two unrelated concerns: 13 of the 47 commits touching it changed only dependencies, and each one built an unchanged build number that App Store Connect rejects as a duplicate. Recurring red builds train you to ignore red builds. Xcode Cloud start conditions match paths and cannot read file contents, so no automatic trigger can express "only when the version line changed". The workflow is now manual-start only and `just release` starts the build through the App Store Connect API instead, which makes the trigger exact. The recipe bumps the version, commits that one path, pushes, and starts the build. Every guard runs before the first mutation so a failure cannot leave a version bump behind with no build to go with it. An optional argument sets a new marketing version; the build number always increments. Also documents asc as one-time setup and corrects the ci_post_clone.sh comment that still described the old pubspec-change trigger. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Why
The Xcode Cloud workflow started on any change to
app/pubspec.yaml. That file carries two unrelated concerns — the version and the dependency list — so the trigger was only an approximation of "the version changed".Measured over the repo's history: 13 of the 47 commits touching
app/pubspec.yamlchanged no version line. Each one built an unchanged build number, which App Store Connect rejects as a duplicate. A 28% false-trigger rate produces recurring red builds, and red builds you learn to ignore are the real cost.Xcode Cloud start conditions are path matchers and cannot read a file's contents, so no automatic trigger can express "only when the
version:line changed". The workflow is now manual-start only (already changed in App Store Connect), and the build is started explicitly through the App Store Connect API.What changed
justfile— areleaserecipe that bumps the version, commits that one path, pushes, and starts the build viaasc xcode-cloud run.CLAUDE.md—ascadded to one-time host setup, plus a Releasing section.app/ios/ci_scripts/ci_post_clone.sh— the comment still claimed a pubspec change triggers a release. Comment only; no behaviour change.Design notes
Every guard runs before the first mutation — invalid semver, not on
main, uncommittedpubspec.yaml,ascmissing. A failure after the push would otherwise leave a version bump behind with no build to go with it.The commit names its path explicitly rather than using
-a, so unrelated work in the tree is never swept in. The build number always increments, including across a marketing-version change, so it stays monotonic within any version.Alternatives considered and rejected: a git-tag trigger (the version was bumped 34 times in 10 days — tags would stop meaning "release"), building on every merge (builds should be explicit), and a mirrored
version.txtwatched by Xcode Cloud (keeping two files in sync is procedural discipline, not a guarantee, and on drift the build would archive a stale number). Triggering from GitHub Actions is feasible and would detect the version line exactly, but was rejected on security-vs-benefit: the repo is public, an App Store Connect API key is team-scoped, and there is no automation gain since the version is bumped from a terminal anyway.Verification
just analyze— no issuesjust test— 791 passedjust functions-check,just functions-test— 8 passedmainbranch, and a valid semver on a non-mainbranch all exit non-zero without touchingpubspec.yamlpubspec.yaml:1.0.0+48→1.0.0+49, and with an argument →1.0.1+49/2.0.0+49asc xcode-cloud runitself was verified live before this PR — a Developer-role key started build run 49, so the API path worksNot verified end to end:
just releasehas never been run to completion, because doing so pushes a commit and starts a real build. The mutating half (sed, commit, push,asc) is composed of pieces verified separately rather than as one run.🤖 Generated with Claude Code