OPS: Upload sourcemaps

This commit is contained in:
Marcos Rodriguez Velez 2024-11-08 00:15:38 -04:00
parent ffc347a7c0
commit 2e3bd2ce05
4 changed files with 58 additions and 15 deletions

View File

@ -137,6 +137,15 @@ jobs:
bundle exec fastlane ios build_app_lane --verbose bundle exec fastlane ios build_app_lane --verbose
echo "ipa_output_path=$IPA_OUTPUT_PATH" >> $GITHUB_OUTPUT # Set the IPA output path for future jobs echo "ipa_output_path=$IPA_OUTPUT_PATH" >> $GITHUB_OUTPUT # Set the IPA output path for future jobs
- name: Upload Bugsnag Sourcemaps
if: success()
run: bundle exec fastlane ios upload_bugsnag_sourcemaps
env:
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
BUGSNAG_RELEASE_STAGE: production
PROJECT_VERSION: ${{ needs.build.outputs.project_version }}
NEW_BUILD_NUMBER: ${{ needs.build.outputs.new_build_number }}
- name: Upload Build Logs - name: Upload Build Logs
if: always() if: always()
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View File

@ -5,8 +5,9 @@ GEM
base64 base64
nkf nkf
rexml rexml
activesupport (7.2.1.2) activesupport (7.2.2)
base64 base64
benchmark (>= 0.3)
bigdecimal bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1) concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5) connection_pool (>= 2.2.5)
@ -24,8 +25,8 @@ GEM
artifactory (3.0.17) artifactory (3.0.17)
atomos (0.1.3) atomos (0.1.3)
aws-eventstream (1.3.0) aws-eventstream (1.3.0)
aws-partitions (1.996.0) aws-partitions (1.1002.0)
aws-sdk-core (3.211.0) aws-sdk-core (3.212.0)
aws-eventstream (~> 1, >= 1.3.0) aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0) aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9) aws-sigv4 (~> 1.9)
@ -33,7 +34,7 @@ GEM
aws-sdk-kms (1.95.0) aws-sdk-kms (1.95.0)
aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5) aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.169.0) aws-sdk-s3 (1.170.0)
aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (~> 1) aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5) aws-sigv4 (~> 1.5)
@ -41,12 +42,13 @@ GEM
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4) babosa (1.0.4)
base64 (0.2.0) base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.8) bigdecimal (3.1.8)
claide (1.1.0) claide (1.1.0)
cocoapods (1.15.2) cocoapods (1.16.2)
addressable (~> 2.8) addressable (~> 2.8)
claide (>= 1.0.2, < 2.0) claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.15.2) cocoapods-core (= 1.16.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0) cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0)
@ -60,8 +62,8 @@ GEM
molinillo (~> 0.8.0) molinillo (~> 0.8.0)
nap (~> 1.0) nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0) ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0) xcodeproj (>= 1.27.0, < 2.0)
cocoapods-core (1.15.2) cocoapods-core (1.16.2)
activesupport (>= 5.0, < 8) activesupport (>= 5.0, < 8)
addressable (~> 2.8) addressable (~> 2.8)
algoliasearch (~> 1.0) algoliasearch (~> 1.0)
@ -170,6 +172,7 @@ GEM
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-plugin-browserstack (0.3.3) fastlane-plugin-browserstack (0.3.3)
rest-client (~> 2.0, >= 2.0.2) rest-client (~> 2.0, >= 2.0.2)
fastlane-plugin-bugsnag_sourcemaps_upload (0.2.0)
fastlane-sirp (1.0.0) fastlane-sirp (1.0.0)
sysrandom (~> 1.0) sysrandom (~> 1.0)
ffi (1.17.0) ffi (1.17.0)
@ -220,21 +223,21 @@ GEM
i18n (1.14.6) i18n (1.14.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
jmespath (1.6.2) jmespath (1.6.2)
json (2.7.4) json (2.8.1)
jwt (2.9.3) jwt (2.9.3)
base64 base64
logger (1.6.1) logger (1.6.1)
mime-types (3.6.0) mime-types (3.6.0)
logger logger
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2024.1001) mime-types-data (3.2024.1105)
mini_magick (4.13.2) mini_magick (4.13.2)
mini_mime (1.1.5) mini_mime (1.1.5)
minitest (5.25.1) minitest (5.25.1)
molinillo (0.8.0) molinillo (0.8.0)
multi_json (1.15.0) multi_json (1.15.0)
multipart-post (2.4.1) multipart-post (2.4.1)
nanaimo (0.3.0) nanaimo (0.4.0)
nap (1.1.0) nap (1.1.0)
naturally (2.2.1) naturally (2.2.1)
netrc (0.11.0) netrc (0.11.0)
@ -285,12 +288,12 @@ GEM
uber (0.1.0) uber (0.1.0)
unicode-display_width (2.6.0) unicode-display_width (2.6.0)
word_wrap (1.0.0) word_wrap (1.0.0)
xcodeproj (1.25.1) xcodeproj (1.27.0)
CFPropertyList (>= 2.3.3, < 4.0) CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3) atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0) claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1) colored2 (~> 3.1)
nanaimo (~> 0.3.0) nanaimo (~> 0.4.0)
rexml (>= 3.3.6, < 4.0) rexml (>= 3.3.6, < 4.0)
xcpretty (0.3.0) xcpretty (0.3.0)
rouge (~> 2.0.7) rouge (~> 2.0.7)
@ -305,10 +308,11 @@ DEPENDENCIES
cocoapods (>= 1.13, != 1.15.1, != 1.15.0) cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
fastlane (>= 2.225.0) fastlane (>= 2.225.0)
fastlane-plugin-browserstack fastlane-plugin-browserstack
fastlane-plugin-bugsnag_sourcemaps_upload
rubyzip (= 2.3.2) rubyzip (= 2.3.2)
RUBY VERSION RUBY VERSION
ruby 3.1.6p260 ruby 3.3.5p100
BUNDLED WITH BUNDLED WITH
2.5.13 2.5.18

View File

@ -336,6 +336,35 @@ platform :ios do
UI.success("Successfully uploaded IPA to TestFlight!") UI.success("Successfully uploaded IPA to TestFlight!")
end end
desc "Upload iOS source maps to Bugsnag"
lane :upload_bugsnag_sourcemaps do
bugsnag_api_key = ENV['BUGSNAG_API_KEY']
bugsnag_release_stage = ENV['BUGSNAG_RELEASE_STAGE'] || "production"
version = ENV['PROJECT_VERSION']
build_number = ENV['NEW_BUILD_NUMBER']
UI.user_error!("BUGSNAG_API_KEY environment variable is missing") if bugsnag_api_key.nil?
UI.user_error!("PROJECT_VERSION environment variable is missing") if version.nil?
UI.user_error!("NEW_BUILD_NUMBER environment variable is missing") if build_number.nil?
ios_sourcemap = "./ios/build/Build/Products/Release-iphonesimulator/main.jsbundle.map"
if File.exist?(ios_sourcemap)
UI.message("Uploading iOS source map to Bugsnag...")
bugsnag_sourcemaps_upload(
api_key: bugsnag_api_key,
source_map: ios_sourcemap,
minified_file: "./ios/main.jsbundle",
code_bundle_id: "#{version}-#{build_number}",
release_stage: bugsnag_release_stage,
app_version: version
)
UI.success("iOS source map uploaded successfully.")
else
UI.error("iOS source map not found at #{ios_sourcemap}")
end
end
desc "Build the iOS app" desc "Build the iOS app"
lane :build_app_lane do lane :build_app_lane do
Dir.chdir(project_root) do Dir.chdir(project_root) do

View File

@ -3,3 +3,4 @@
# Ensure this file is checked in to source control! # Ensure this file is checked in to source control!
gem 'fastlane-plugin-browserstack' gem 'fastlane-plugin-browserstack'
gem 'fastlane-plugin-bugsnag_sourcemaps_upload'