From 37dc22af1780fdea52064fd2d95b94f98f113b2d Mon Sep 17 00:00:00 2001 From: dab246 Date: Tue, 21 Apr 2026 12:17:46 +0700 Subject: [PATCH] TF-4269 Fix Sentry dSYM upload: find xcarchive via find instead of gym_archive_path.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lane_context[XCODEBUILD_ARCHIVE] was unreliable — replace with find on ~/Library/Developer/Xcode/Archives to locate the Runner xcarchive directly. --- .github/workflows/release.yaml | 8 ++++---- ios/.gitignore | 3 --- ios/fastlane/Fastfile | 4 ---- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d778282c6..179323644 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -162,11 +162,11 @@ jobs: exit 1 fi - # 3. Read the xcarchive path written by Fastlane after build_app. - # Fastlane writes lane_context[XCODEBUILD_ARCHIVE] to ios/gym_archive_path.txt. - XCARCHIVE=$(cat ios/gym_archive_path.txt 2>/dev/null) + # 3. Find the xcarchive built by Fastlane. + # Xcode always archives to ~/Library/Developer/Xcode/Archives — pick the most recent one. + XCARCHIVE=$(find "$HOME/Library/Developer/Xcode/Archives" -name "Runner*.xcarchive" -maxdepth 3 2>/dev/null | sort -r | head -1) if [ -z "$XCARCHIVE" ] || [ ! -d "$XCARCHIVE" ]; then - echo "::error::xcarchive not found. Check that Fastlane wrote gym_archive_path.txt correctly." + echo "::error::Runner xcarchive not found in ~/Library/Developer/Xcode/Archives" exit 1 fi echo "Found xcarchive: $XCARCHIVE" diff --git a/ios/.gitignore b/ios/.gitignore index e34a96caf..da38b0877 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -26,9 +26,6 @@ ServiceDefinitions.json Runner/GeneratedPluginRegistrant.* Flutter/ephemeral/ -# Build artifacts generated by Fastlane -gym_archive_path.txt - # Exceptions to above rules. !default.mode1v3 !default.mode2v3 diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 80e593bdd..c83b883da 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -56,10 +56,6 @@ platform :ios do workspace: "Runner.xcworkspace", export_method: "app-store" ) - # Write the xcarchive path to a file so CI can locate dSYMs for Sentry upload. - # lane_context[XCODEBUILD_ARCHIVE] is set by build_app and contains the exact path. - archive_path = Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE] - File.write("gym_archive_path.txt", archive_path.to_s) if archive_path upload_to_testflight( skip_waiting_for_build_processing: true, ipa: "Runner.ipa"