Skip to content

Commit b520981

Browse files
authored
[#615] TestFlight에서 dSYM 보존 및 Crashlytics 업로드를 자동화한다 (#616)
* chore: TestFlight CD dSYM 보존 추가 * chore: Homebrew tap trust 경고 대응 * refactor: Firebase에 dsym 자동 업로드 * refactor: fastlane dSYM 로그 처리 개선
1 parent 227947f commit b520981

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/testflight.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ jobs:
9191
cache: true
9292

9393
- name: Install SwiftLint
94+
env:
95+
HOMEBREW_REQUIRE_TAP_TRUST: "1"
9496
shell: bash
9597
run: |
9698
set -euo pipefail
@@ -114,6 +116,32 @@ jobs:
114116
- name: Build for TestFlight
115117
run: bundle exec fastlane testflight_build_only
116118

119+
- name: Upload dSYM to Firebase Crashlytics
120+
shell: bash
121+
run: |
122+
set -euo pipefail
123+
124+
google_service_info_path="Application/DevLogApp/Sources/Resource/GoogleService-Info.plist"
125+
dsym_zip_path="$(find fastlane/testflight_build -maxdepth 1 -name '*.dSYM.zip' -print -quit)"
126+
upload_symbols_path="$(find "$HOME/Library/Developer/Xcode/DerivedData" "$HOME/Library/Developer/Xcode/SourcePackages" "$GITHUB_WORKSPACE" -path '*/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/upload-symbols' -type f -print -quit 2>/dev/null || true)"
127+
128+
if [ ! -f "$google_service_info_path" ]; then
129+
echo "Missing GoogleService-Info.plist at $google_service_info_path" >&2
130+
exit 1
131+
fi
132+
133+
if [ -z "$dsym_zip_path" ]; then
134+
echo "Missing dSYM zip in fastlane/testflight_build" >&2
135+
exit 1
136+
fi
137+
138+
if [ -z "$upload_symbols_path" ]; then
139+
echo "Missing Firebase Crashlytics upload-symbols script" >&2
140+
exit 1
141+
fi
142+
143+
"$upload_symbols_path" -gsp "$google_service_info_path" -p ios "$dsym_zip_path"
144+
117145
- name: Upload TestFlight build log
118146
if: always()
119147
uses: actions/upload-artifact@v6
@@ -122,6 +150,14 @@ jobs:
122150
path: ~/Library/Logs/gym/*.log
123151
if-no-files-found: ignore
124152

153+
- name: Upload TestFlight dSYM
154+
if: always()
155+
uses: actions/upload-artifact@v6
156+
with:
157+
name: testflight-dsym
158+
path: fastlane/testflight_build/*.dSYM.zip
159+
if-no-files-found: warn
160+
125161
- name: Skip TestFlight Upload
126162
if: (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'qa-local')) || (github.event_name == 'workflow_dispatch' && inputs.upload_to_app_store_connect != 'true')
127163
run: echo "Skipping TestFlight upload"

fastlane/Fastfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,15 @@ platform :ios do
131131
export_method: "app-store",
132132
output_directory: TESTFLIGHT_BUILD_OUTPUT_DIRECTORY,
133133
output_name: "#{APP_PRODUCT_NAME}.ipa",
134+
include_symbols: true,
134135
xcargs: "-skipPackagePluginValidation -skipMacroValidation"
135136
)
136137

138+
dsym_output_path = lane_context[SharedValues::DSYM_OUTPUT_PATH]
139+
archive_path = lane_context[SharedValues::XCODEBUILD_ARCHIVE]
140+
UI.message("dSYM output path: #{dsym_output_path}") unless dsym_output_path.to_s.empty?
141+
UI.message("Xcode archive path: #{archive_path}") unless archive_path.to_s.empty?
142+
137143
next api_key
138144
end
139145

0 commit comments

Comments
 (0)