From 12eba9d5e17a66be5a4459c191fb4b196b4d4e4c Mon Sep 17 00:00:00 2001 From: Gergely Hegedus Date: Sun, 19 Nov 2023 00:01:48 +0200 Subject: [PATCH] update fastlane to upload native_debug_symbols --- fastlane/Fastfile | 23 ++++++++++++++++++++++- fastlane/README.md | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 8ebfed3..d8f9130 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -54,7 +54,11 @@ platform :android do "versionCode" => version_code } ) - production_aab = lane_context[SharedValues::GRADLE_ALL_AAB_OUTPUT_PATHS].find{ |i| i[/app-*release*.aab/] } + production_aab = lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH] + mapping_file_path = lane_context[SharedValues::GRADLE_MAPPING_TXT_OUTPUT_PATH] + + native_debug_symbols_path = "./native_debug_symbols.zip" + zipReleaseNativeSymbols(output_path: native_debug_symbols_path) upload_to_play_store( track: 'internal', @@ -63,6 +67,23 @@ platform :android do json_key: PLAY_STORE_AUTH_FILE, skip_upload_apk: true, package_name: package_name, + mapping_paths: [mapping_file_path, native_debug_symbols_path] ) end + + desc "Zip the native_debug_symbols" + desc "By default zips the release version" + desc ">You may change the file name and build_type_and_flavour via:" + desc "```sh" + desc "[bundle exec] fastlane zipReleaseNativeSymbols output_path:./new.zip build_type_and_flavour:stagingRelease" + desc "```" + lane :zipReleaseNativeSymbols do |options| + # ref https://github.com/fastlane/fastlane/issues/21064 + output_path = options[:output_path] || './native_debug_symbols.zip' + build_type_and_flavour = options[:build_type_and_flavour] || 'release' + symbolsFilePath = File.join(Dir.pwd, "..", output_path) + symbolsFolderPath = File.join(Dir.pwd, "..", "app/build/intermediates/merged_native_libs",build_type_and_flavour,"out/lib") + + system("cd #{symbolsFolderPath} && zip -r #{symbolsFilePath} .") + end end diff --git a/fastlane/README.md b/fastlane/README.md index 7fd5f2f..76a3caf 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -33,6 +33,24 @@ By Default it sets the version_code to last from PlayStore + 1. ``` +### android zipReleaseNativeSymbols + +```sh +[bundle exec] fastlane android zipReleaseNativeSymbols +``` + +Zip the native_debug_symbols + +By default zips the release version + +>You may change the file name and build_type_and_flavour via: + +```sh + +[bundle exec] fastlane zipReleaseNativeSymbols output_path:./new.zip build_type_and_flavour:stagingRelease + +``` + ---- This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.