3 changed files with 31 additions and 29 deletions
@@ -25,15 +25,29 @@ module Fastlane
UI.message("👉🏼 App built") UI.message("👉🏼 App built")
# Upload the Android App Bundle to the Play Store # Upload the Android App Bundle to the Play Store
other_action.upload_to_play_store( begin
track: params[:beta_type], other_action.upload_to_play_store(
json_key: './service_account_key.json', track: params[:beta_type],
aab: '../build/app/outputs/bundle/release/app-release.aab', json_key: './service_account_key.json',
skip_upload_metadata: true, aab: '../build/app/outputs/bundle/release/app-release.aab',
skip_upload_images: true, skip_upload_metadata: true,
skip_upload_screenshots: true, skip_upload_images: true,
release_status: "draft" skip_upload_screenshots: true,
) release_status: "completed"
)
rescue StandardError => e
UI.message("👉🏼 Unable to upload as completed; try to upload it in draft status")
other_action.upload_to_play_store(
track: params[:beta_type],
json_key: './service_account_key.json',
aab: '../build/app/outputs/bundle/release/app-release.aab',
skip_upload_metadata: true,
skip_upload_images: true,
skip_upload_screenshots: true,
release_status: "draft"
)
end
# Delete artifacts files # Delete artifacts files
artifacts = ['android_keys.zip', 'key.jks', 'key.properties', 'service_account_key.json'] artifacts = ['android_keys.zip', 'key.jks', 'key.properties', 'service_account_key.json']
@@ -7,12 +7,12 @@ module Fastlane
def self.run(params) def self.run(params)
# Check from parameters # Check from parameters
unless Helper::AndroidCdHelper.is_set(params[:from]) unless Helper::AndroidCdHelper.is_set(params[:from])
UI.user_error!("❌ Parameters from cannot be null") raise ArgumentError, "❌ Parameters from cannot be null"
end end
# Check destination parameters # Check destination parameters
unless Helper::AndroidCdHelper.is_set(params[:destination]) unless Helper::AndroidCdHelper.is_set(params[:destination])
UI.user_error!("❌ Parameters destination cannot be null") raise ArgumentError, "❌ Parameters destination cannot be null"
end end
UI.message("⌛️ Promoting to Google Play Store from #{params[:from]} to #{params[:destination]}..") UI.message("⌛️ Promoting to Google Play Store from #{params[:from]} to #{params[:destination]}..")
@@ -23,6 +23,7 @@ module Fastlane
# Upload the Android App Bundle to the Play Store # Upload the Android App Bundle to the Play Store
other_action.upload_to_play_store( other_action.upload_to_play_store(
track: params[:from], track: params[:from],
track_promote_to: params[:destination],
json_key: './service_account_key.json', json_key: './service_account_key.json',
skip_upload_apk: true, skip_upload_apk: true,
skip_upload_aab: true, skip_upload_aab: true,
@@ -32,6 +33,10 @@ module Fastlane
skip_upload_screenshots: true skip_upload_screenshots: true
) )
# Delete artifacts files
artifacts = ['android_keys.zip', 'key.jks', 'key.properties', 'service_account_key.json']
Helper::AndroidCdHelper.delete_artifacts(artifacts)
UI.success('🍺 Successfully promote appbundle to Google Play Store') UI.success('🍺 Successfully promote appbundle to Google Play Store')
end end
@@ -36,7 +36,7 @@ module Fastlane
Helper::IosCdHelper.check_required_fields(required_fields, creds.keys) Helper::IosCdHelper.check_required_fields(required_fields, creds.keys)
# Delete keychain if existing # Delete keychain if existing
if File.exist?(File.expand_path("~/Library/Keychains/#{name}-db")) if File.exist?(File.expand_path("~/Library/Keychains/#{creds['temp_keychain_user']}-db"))
other_action.delete_keychain( other_action.delete_keychain(
name: creds['temp_keychain_user'].to_s name: creds['temp_keychain_user'].to_s
) )
@@ -61,23 +61,6 @@ module Fastlane
) )
UI.message("🍺 API Key formated") UI.message("🍺 API Key formated")
last_testflight_build_number =
other_action.latest_testflight_build_number(
api_key: api_key,
team_id: creds['team_id'].to_s,
team_name: creds['team_name'].to_s,
platform: 'ios',
app_identifier: creds['developer_app_identifier'].to_s,
username: creds['username'].to_s
) + 1
# Increment build number for latest TestFlight build
other_action.increment_build_number(
build_number: last_testflight_build_number,
xcodeproj: "Runner.xcodeproj"
)
UI.message("🍺 Build number incremented")
# Install Cocoapods # Install Cocoapods
other_action.cocoapods( other_action.cocoapods(
clean_install: true, clean_install: true,