From 71299744dac7707980cb2a4cf62fbc34f9956569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Thu, 10 Aug 2023 13:05:32 +0200 Subject: [PATCH] feat: action try to upload as completed before draft --- .../actions/build_and_deploy_action.rb | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/actions/build_and_deploy_action.rb b/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/actions/build_and_deploy_action.rb index 504080e..b9a009f 100644 --- a/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/actions/build_and_deploy_action.rb +++ b/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/actions/build_and_deploy_action.rb @@ -25,15 +25,29 @@ module Fastlane UI.message("👉🏼 App built") # Upload the Android App Bundle to the Play Store - 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" - ) + begin + 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: "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 artifacts = ['android_keys.zip', 'key.jks', 'key.properties', 'service_account_key.json']