diff --git a/.github/workflows/ios_sentry_upload_adhoc.yml b/.github/workflows/ios_sentry_upload_adhoc.yml index dd1d750d..defda50a 100644 --- a/.github/workflows/ios_sentry_upload_adhoc.yml +++ b/.github/workflows/ios_sentry_upload_adhoc.yml @@ -7,6 +7,7 @@ on: jobs: build_distribution: + if: github.event_name != 'pull_request' || github.head_ref != 'codex/test-sentry-cli-dsym-e2e' runs-on: macos-26 defaults: diff --git a/.github/workflows/ios_sentry_upload_pr.yml b/.github/workflows/ios_sentry_upload_pr.yml index 255a119d..c5fa19f2 100644 --- a/.github/workflows/ios_sentry_upload_pr.yml +++ b/.github/workflows/ios_sentry_upload_pr.yml @@ -19,6 +19,19 @@ jobs: with: fetch-depth: 0 + - name: Checkout sentry-cli + uses: actions/checkout@v6 + with: + repository: getsentry/sentry-cli + ref: c596fcddd616867b6c6cdfa11f9853dc889a585a + path: sentry-cli + + - name: Build sentry-cli + working-directory: ${{ github.workspace }}/sentry-cli + run: | + rustup target add aarch64-apple-darwin + cargo build --release --locked --target aarch64-apple-darwin + - name: Set up Ruby env uses: ruby/setup-ruby@v1 with: @@ -43,6 +56,9 @@ jobs: ASC_KEY: ${{ secrets.ASC_PRIVATE_KEY }} SIGNING_KEY_PASSWORD: ${{ secrets.IOS_DIST_SIGNING_KEY_PASSWORD }} SIGNING_KEY_FILE_PATH: signing-cert.p12 + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SENTRY_AUTH_TOKEN }} + SENTRY_CLI_PATH: ${{ github.workspace }}/sentry-cli/target/aarch64-apple-darwin/release/sentry-cli + SENTRY_LOG_LEVEL: debug SENTRY_SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SENTRY_AUTH_TOKEN }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} CONFIGURATION: Release diff --git a/.github/workflows/ios_sentry_upload_snapshots.yml b/.github/workflows/ios_sentry_upload_snapshots.yml index b5b8ad59..4d42e135 100644 --- a/.github/workflows/ios_sentry_upload_snapshots.yml +++ b/.github/workflows/ios_sentry_upload_snapshots.yml @@ -21,6 +21,7 @@ jobs: # Build the snapshot test bundle once on a single runner, then share the # products with downstream simulator jobs via an artifact. build_for_testing: + if: github.event_name != 'pull_request' || github.head_ref != 'codex/test-sentry-cli-dsym-e2e' runs-on: macos-26 env: @@ -209,4 +210,4 @@ jobs: - name: Upload snapshots to Sentry env: SENTRY_SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SENTRY_AUTH_TOKEN }} - run: bundle exec fastlane ios upload_sentry_snapshots path:"${SNAPSHOT_UPLOAD_BASE_DIR}" \ No newline at end of file + run: bundle exec fastlane ios upload_sentry_snapshots path:"${SNAPSHOT_UPLOAD_BASE_DIR}" diff --git a/.github/workflows/ios_sentry_upload_swift_snapshots.yml b/.github/workflows/ios_sentry_upload_swift_snapshots.yml index e93ddccf..bf32ab7d 100644 --- a/.github/workflows/ios_sentry_upload_swift_snapshots.yml +++ b/.github/workflows/ios_sentry_upload_swift_snapshots.yml @@ -9,6 +9,7 @@ on: jobs: upload_sentry_swift_snapshots: + if: github.event_name != 'pull_request' || github.head_ref != 'codex/test-sentry-cli-dsym-e2e' runs-on: macos-26 defaults: diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock index 87d4f76e..4644a64e 100644 --- a/ios/Gemfile.lock +++ b/ios/Gemfile.lock @@ -1,3 +1,11 @@ +GIT + remote: https://github.com/getsentry/sentry-fastlane-plugin.git + revision: 0fe84e64455d7f6643976368c04a5496b1a3f263 + branch: codex/ipa-dsym-build-upload + specs: + fastlane-plugin-sentry (2.6.2) + os (~> 1.1, >= 1.1.4) + GEM remote: https://rubygems.org/ specs: @@ -123,8 +131,6 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.4.1) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) - fastlane-plugin-sentry (2.5.2) - os (~> 1.1, >= 1.1.4) fastlane-sirp (1.1.0) gh_inspector (1.1.3) google-apis-androidpublisher_v3 (0.102.0) @@ -242,7 +248,7 @@ PLATFORMS DEPENDENCIES fastlane - fastlane-plugin-sentry (>= 2.5.1, < 3.0.0) + fastlane-plugin-sentry (>= 2.5.1, < 3.0.0)! xcpretty BUNDLED WITH diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index c1944c97..9a5b555f 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -186,19 +186,41 @@ platform :ios do prepare_signing build_app_for_scheme ipa_path = export_thinned_size_analysis_ipa - xcarchive_path = lane_context[SharedValues::XCODEBUILD_ARCHIVE] - replace_xcarchive_app_with_ipa( - ipa_path: ipa_path, - xcarchive_path: xcarchive_path - ) - sentry_upload_build( - auth_token: ENV['SENTRY_SENTRY_AUTH_TOKEN'], - org_slug: 'sentry', - project_slug: 'hackernews-ios', - xcarchive_path: xcarchive_path, - build_configuration: 'Release', - log_level: 'debug' + xcarchive_path = File.expand_path( + lane_context[SharedValues::XCODEBUILD_ARCHIVE], + File.expand_path('..', __dir__) ) + + if ENV['SENTRY_CLI_PATH'] + dsym_path = File.join(xcarchive_path, 'dSYMs') + UI.important( + "Testing IPA+dSYM upload through fastlane-plugin-sentry with #{ENV.fetch('SENTRY_CLI_PATH')}: " \ + "IPA=#{ipa_path}, dSYMs=#{dsym_path}" + ) + sentry_upload_build( + auth_token: ENV['SENTRY_SENTRY_AUTH_TOKEN'], + org_slug: 'sentry', + project_slug: 'hackernews-ios', + ipa_path: ipa_path, + dsym_path: dsym_path, + sentry_cli_path: ENV.fetch('SENTRY_CLI_PATH'), + build_configuration: 'Release-dsym-e2e', + log_level: 'debug' + ) + else + replace_xcarchive_app_with_ipa( + ipa_path: ipa_path, + xcarchive_path: xcarchive_path + ) + sentry_upload_build( + auth_token: ENV['SENTRY_SENTRY_AUTH_TOKEN'], + org_slug: 'sentry', + project_slug: 'hackernews-ios', + xcarchive_path: xcarchive_path, + build_configuration: 'Release', + log_level: 'debug' + ) + end end desc 'Export a thinned Release IPA for Sentry Size Analysis' diff --git a/ios/fastlane/Pluginfile b/ios/fastlane/Pluginfile index 521e6116..001bc6ae 100644 --- a/ios/fastlane/Pluginfile +++ b/ios/fastlane/Pluginfile @@ -2,4 +2,6 @@ # # Ensure this file is checked in to source control! -gem 'fastlane-plugin-sentry', '>= 2.5.1', '< 3.0.0' +gem 'fastlane-plugin-sentry', '>= 2.5.1', '< 3.0.0', + git: 'https://github.com/getsentry/sentry-fastlane-plugin.git', + branch: 'codex/ipa-dsym-build-upload'