fix(ios): stop xcodegen from archiving the previous App Store version

Cloud #50 exported 1.74.0 because project.yml hardcoded MARKETING_VERSION
and ci_post_clone regenerated the Xcode project from that YAML. Keep the
version in Version.xcconfig and stamp it into the pbxproj before archive.
This commit is contained in:
tianma-if committed 2026-09-20 23:57:33 +08:00
1 parent 5880699347
commit fabfede7e0
9 files changed
+68 -20

No files matched your search

+11 -5
View File
@@ -311,7 +311,9 @@ jobs:
log_file="$RUNNER_TEMP/xcode-cloud-control.log"
# Manual Xcode Cloud workflows reject tags that are not in the start
# condition. Start the Archive workflow on its configured default
# (main) and require the iOS runtime tree to match this Release.
# (main) and require that source's marketing version matches this
# Release. The Git tag itself may still contain a stale project.yml
# that xcodegen would archive as the previous live version.
python3 .edgeever-ci/scripts/xcode-cloud-control.py start \
--wait \
--wait-valid |
@@ -322,10 +324,14 @@ jobs:
source_sha="$(grep -E '^source_sha=' "$log_file" | tail -1 | cut -d= -f2)"
test -n "$source_sha"
git fetch --no-tags origin "$source_sha"
changed="$(git diff --name-only "$source_sha" HEAD -- apps/ios packages/shared)"
if [[ -n "$changed" ]]; then
echo "Xcode Cloud source $source_sha differs from Release $(git rev-parse HEAD) in iOS runtime files:" >&2
echo "$changed" >&2
cloud_version="$(
git show "$source_sha:apps/ios/Config/Version.xcconfig" |
sed -nE 's/^MARKETING_VERSION[[:space:]]*=[[:space:]]*([^[:space:]]+).*/\1/p' |
head -1
)"
release_version="${RELEASE_TAG#v}"
if [[ "$cloud_version" != "$release_version" ]]; then
echo "Xcode Cloud source $source_sha MARKETING_VERSION=$cloud_version does not match $RELEASE_TAG." >&2
exit 1
fi