From 10993c96e294ff04cab05d9751def0290009df9c Mon Sep 17 00:00:00 2001 From: Wesley Keetch Date: Thu, 3 Sep 2026 15:55:43 -0400 Subject: [PATCH 1/2] ci: stamp Xcode Cloud build numbers into Release archives - When CI_BUILD_NUMBER is set (Xcode Cloud), the Release build phase writes it to CFBundleVersion and leaves the checkout untouched - buildnumber.txt is local-only (gitignored), so fresh CI clones would otherwise always produce build 2 and collide on App Store Connect upload; local Release archives keep the existing increment-from-file behavior - Xcode Cloud hosts the single archiving workflow, so per-workflow CI_BUILD_NUMBER values stay unique in App Store Connect --- SunHat.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SunHat.xcodeproj/project.pbxproj b/SunHat.xcodeproj/project.pbxproj index 4bfac31..18a7f7d 100644 --- a/SunHat.xcodeproj/project.pbxproj +++ b/SunHat.xcodeproj/project.pbxproj @@ -102,7 +102,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Only runs during Release (Archive uses Release); skipped in Debug.\n# Reads buildnumber.txt, increments by 1, writes the new number back\n# to the file AND into the built product's Info.plist. After archiving,\n# commit the updated buildnumber.txt to lock in the number.\nif [ \"$CONFIGURATION\" != \"Release\" ]; then\n exit 0\nfi\n\nBUILD_NUMBER_FILE=\"$SRCROOT/buildnumber.txt\"\nif [ ! -f \"$BUILD_NUMBER_FILE\" ]; then\n echo \"1\" > \"$BUILD_NUMBER_FILE\"\nfi\n\nCURRENT=$(cat \"$BUILD_NUMBER_FILE\")\nBUILD_NUMBER=$((CURRENT + 1))\necho \"$BUILD_NUMBER\" > \"$BUILD_NUMBER_FILE\"\n\nPLIST=\"$TARGET_BUILD_DIR/$INFOPLIST_PATH\"\necho \"[SunHat] Build number: $CURRENT -> $BUILD_NUMBER\"\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $BUILD_NUMBER\" \"$PLIST\"\n"; + shellScript = "# Build-number policy:\n# - Xcode Cloud (CI_BUILD_NUMBER set): CFBundleVersion = CI_BUILD_NUMBER.\n# Xcode Cloud numbers are per-workflow and strictly increasing, and this\n# workflow is the only one that archives, so App Store Connect uploads\n# never collide. The CI checkout is never modified: buildnumber.txt is a\n# local-only file (gitignored).\n# - Local Release archives: read buildnumber.txt, increment by 1, write the\n# new number back to the file AND into the built product's Info.plist.\n# Local numbers are throwaway; Xcode Cloud is authoritative for uploads.\nif [ \"$CONFIGURATION\" != \"Release\" ]; then\n exit 0\nfi\n\nPLIST=\"$TARGET_BUILD_DIR/$INFOPLIST_PATH\"\n\nif [ -n \"$CI_BUILD_NUMBER\" ]; then\n echo \"[SunHat] Xcode Cloud build: CFBundleVersion = $CI_BUILD_NUMBER\"\n /usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $CI_BUILD_NUMBER\" \"$PLIST\"\n exit 0\nfi\n\nBUILD_NUMBER_FILE=\"$SRCROOT/buildnumber.txt\"\nif [ ! -f \"$BUILD_NUMBER_FILE\" ]; then\n echo \"1\" > \"$BUILD_NUMBER_FILE\"\nfi\n\nCURRENT=$(cat \"$BUILD_NUMBER_FILE\")\nBUILD_NUMBER=$((CURRENT + 1))\necho \"$BUILD_NUMBER\" > \"$BUILD_NUMBER_FILE\"\n\necho \"[SunHat] Build number: $CURRENT -> $BUILD_NUMBER\"\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $BUILD_NUMBER\" \"$PLIST\"\n"; }; /* End PBXShellScriptBuildPhase section */ From 9601a7e11d519ce54231c241baeb168b48235ac3 Mon Sep 17 00:00:00 2001 From: Wesley Keetch Date: Thu, 3 Sep 2026 16:24:24 -0400 Subject: [PATCH 2/2] ci: attach the StoreKit-Testing storefront to the unit-test scheme SunHatUnitTests' TestAction had no StoreKitConfigurationFileReference, so once feature/ads-and-iap merges, StoreManagerStoreKitTests would run storefront-less and fail on PR validation. Mirror the SunHat scheme's reference so both shared schemes test against the same local storefront. No behavior change for the current unit suite (no StoreKit tests on main yet); verified: 298 tests / 60 suites pass through this scheme. --- .../xcshareddata/xcschemes/SunHatUnitTests.xcscheme | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SunHat.xcodeproj/xcshareddata/xcschemes/SunHatUnitTests.xcscheme b/SunHat.xcodeproj/xcshareddata/xcschemes/SunHatUnitTests.xcscheme index 9ecfd22..68aa23e 100644 --- a/SunHat.xcodeproj/xcshareddata/xcschemes/SunHatUnitTests.xcscheme +++ b/SunHat.xcodeproj/xcshareddata/xcschemes/SunHatUnitTests.xcscheme @@ -52,6 +52,9 @@ ReferencedContainer = "container:SunHat.xcodeproj"> + +