TF-4269 Fix Sentry dSYM upload: find xcarchive via find instead of gym_archive_path.txt
lane_context[XCODEBUILD_ARCHIVE] was unreliable — replace with find on ~/Library/Developer/Xcode/Archives to locate the Runner xcarchive directly.
This commit is contained in:
@@ -162,11 +162,11 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 3. Read the xcarchive path written by Fastlane after build_app.
|
# 3. Find the xcarchive built by Fastlane.
|
||||||
# Fastlane writes lane_context[XCODEBUILD_ARCHIVE] to ios/gym_archive_path.txt.
|
# Xcode always archives to ~/Library/Developer/Xcode/Archives — pick the most recent one.
|
||||||
XCARCHIVE=$(cat ios/gym_archive_path.txt 2>/dev/null)
|
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
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Found xcarchive: $XCARCHIVE"
|
echo "Found xcarchive: $XCARCHIVE"
|
||||||
|
|||||||
@@ -26,9 +26,6 @@ ServiceDefinitions.json
|
|||||||
Runner/GeneratedPluginRegistrant.*
|
Runner/GeneratedPluginRegistrant.*
|
||||||
Flutter/ephemeral/
|
Flutter/ephemeral/
|
||||||
|
|
||||||
# Build artifacts generated by Fastlane
|
|
||||||
gym_archive_path.txt
|
|
||||||
|
|
||||||
# Exceptions to above rules.
|
# Exceptions to above rules.
|
||||||
!default.mode1v3
|
!default.mode1v3
|
||||||
!default.mode2v3
|
!default.mode2v3
|
||||||
|
|||||||
@@ -56,10 +56,6 @@ platform :ios do
|
|||||||
workspace: "Runner.xcworkspace",
|
workspace: "Runner.xcworkspace",
|
||||||
export_method: "app-store"
|
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(
|
upload_to_testflight(
|
||||||
skip_waiting_for_build_processing: true,
|
skip_waiting_for_build_processing: true,
|
||||||
ipa: "Runner.ipa"
|
ipa: "Runner.ipa"
|
||||||
|
|||||||
Reference in New Issue
Block a user