Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ios_sentry_upload_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: |
echo $CERTIFICATE_BASE64 | base64 --decode > signing-cert.p12

- name: Build Release app and upload thinned XCArchive to Sentry
- name: Build Release app and upload thinned IPA to Sentry
run: bundle exec fastlane ios build_upload_thinned_sentry_size_analysis
env:
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
Expand Down
4 changes: 2 additions & 2 deletions ios/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ 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)
fastlane-plugin-sentry (2.7.0)
os (~> 1.1, >= 1.1.4)
fastlane-sirp (1.1.0)
gh_inspector (1.1.3)
Expand Down Expand Up @@ -242,7 +242,7 @@ PLATFORMS

DEPENDENCIES
fastlane
fastlane-plugin-sentry (>= 2.5.1, < 3.0.0)
fastlane-plugin-sentry (>= 2.7.0, < 3.0.0)
xcpretty

BUNDLED WITH
Expand Down
67 changes: 6 additions & 61 deletions ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -180,22 +180,22 @@ platform :ios do
)
end

desc 'Build, thin, and upload an XCArchive to Sentry for Size Analysis'
desc 'Build, thin, and upload an IPA to Sentry for Size Analysis'
lane :build_upload_thinned_sentry_size_analysis do
load_asc_api_key
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
xcarchive_path = File.expand_path(
lane_context[SharedValues::XCODEBUILD_ARCHIVE],
File.expand_path('..', __dir__)
)
sentry_upload_build(
auth_token: ENV['SENTRY_SENTRY_AUTH_TOKEN'],
org_slug: 'sentry',
project_slug: 'hackernews-ios',
xcarchive_path: xcarchive_path,
ipa_path: ipa_path,
dsym_path: File.join(xcarchive_path, 'dSYMs'),
build_configuration: 'Release',
log_level: 'debug'
)
Expand Down Expand Up @@ -269,61 +269,6 @@ platform :ios do
ipa_path
end

desc 'Replace the app in an XCArchive with the app from an IPA'
private_lane :replace_xcarchive_app_with_ipa do |options|
xcarchive_path = options[:xcarchive_path]
ipa_path = options[:ipa_path]
UI.user_error!('No XCArchive provided') unless xcarchive_path
UI.user_error!('No IPA provided') unless ipa_path

project_root = File.expand_path('..', __dir__)
xcarchive_path = File.expand_path(xcarchive_path, project_root)
ipa_path = File.expand_path(ipa_path, project_root)
extracted_ipa_path = File.join(project_root, 'build', 'sentry-size-analysis', 'extracted-ipa')

UI.user_error!("XCArchive not found at #{xcarchive_path}") unless File.directory?(xcarchive_path)
UI.user_error!("IPA not found at #{ipa_path}") unless File.file?(ipa_path)

FileUtils.rm_rf(extracted_ipa_path)
FileUtils.mkdir_p(extracted_ipa_path)
sh(
[
'/usr/bin/ditto',
'-x', '-k',
Shellwords.escape(ipa_path),
Shellwords.escape(extracted_ipa_path)
].join(' ')
)

ipa_app_paths = Dir.glob(File.join(extracted_ipa_path, 'Payload', '*.app'))
unless ipa_app_paths.one?
UI.user_error!("Expected one app in the IPA, found #{ipa_app_paths.length}")
end
ipa_app_path = ipa_app_paths.first

xcarchive_app_path = File.join(
xcarchive_path,
'Products',
'Applications',
File.basename(ipa_app_path)
)
unless File.directory?(xcarchive_app_path)
UI.user_error!("No app matching #{File.basename(ipa_app_path)} found in the XCArchive")
end

# Keep the XCArchive's dSYMs and metadata while replacing its app payload.
FileUtils.rm_rf(xcarchive_app_path)
sh(
[
'/usr/bin/ditto',
Shellwords.escape(ipa_app_path),
Shellwords.escape(xcarchive_app_path)
].join(' ')
)

UI.success("Replaced the XCArchive app with the IPA app: #{xcarchive_app_path}")
end

desc 'Build an Ad Hoc archive and upload it to Sentry Build Distribution'
lane :build_upload_sentry_distribution do
load_asc_api_key
Expand Down
2 changes: 1 addition & 1 deletion ios/fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-sentry', '>= 2.5.1', '< 3.0.0'
gem 'fastlane-plugin-sentry', '>= 2.7.0', '< 3.0.0'
Loading