Added the support for submitting Android app bundle to Google Play (#5932)

* Added the support for submitting Android app bundle to Google Play

* Review fix: Added aab_filename instead of file_path in supply call
This commit is contained in:
Manoj Malik 2022-02-08 16:53:06 +05:30 committed by GitHub
parent 7d442d3f72
commit f2db547d78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -708,10 +708,10 @@ platform :android do
end
lane :deploy do |options|
apk_path = options[:file]
file_path = options[:file]
unless apk_path.nil?
submit_to_google_play(apk_path)
unless file_path.nil?
submit_to_google_play(file_path)
end
end
@ -932,21 +932,34 @@ def submit_to_testflight(ipa_path)
})
end
def submit_to_google_play(apk_path)
apks = Dir.glob(apk_path).select { |f| File.file? f}
filenames = apks.map {|f| File.basename(f)}
if(apks.length > 0)
def submit_to_google_play(file_path)
if(file_path.include?("aab"))
aab_filename = Dir.glob(file_path).select { |f| File.file? f}.first
unless ENV['SUPPLY_JSON_KEY'].nil? || ENV['SUPPLY_JSON_KEY'].empty?
supply(
package_name: ENV['MAIN_APP_IDENTIFIER'] || ENV['SUPPLY_PACKAGE_NAME'],
track: ENV['SUPPLY_TRACK'] || 'alpha',
apk_paths: apks
aab: aab_filename,
skip_upload_apk: true
)
end
else
UI.user_error! "There are no apks in #{apk_path}"
return
apks = Dir.glob(file_path).select { |f| File.file? f}
filenames = apks.map {|f| File.basename(f)}
if(apks.length > 0)
unless ENV['SUPPLY_JSON_KEY'].nil? || ENV['SUPPLY_JSON_KEY'].empty?
supply(
package_name: ENV['MAIN_APP_IDENTIFIER'] || ENV['SUPPLY_PACKAGE_NAME'],
track: ENV['SUPPLY_TRACK'] || 'alpha',
apk_paths: apks,
skip_upload_aab: true
)
end
else
UI.user_error! "There are no apks in #{file_path}"
return
end
end
version_number = android_get_version_name(gradle_file: './android/app/build.gradle')