feat: add promote feature (#1)

This commit is contained in:
Malo Léon 2023-04-26 11:27:58 +02:00
parent c36c30ff75
commit bd46322ab3
3 changed files with 78 additions and 2 deletions

View File

@ -11,7 +11,7 @@ module Fastlane
puts("Error on beta type parameter")
end
UI.message("Building and deploying to Google Play Store in #{params[:beta_type]}")
UI.message("⌛️ Building and deploying to Google Play Store in #{params[:beta_type]}..")
# Decrypt the keys archive and Extract the keys archive
Helper::AndroidCdHelper.decrypt_android_keys('.')
@ -59,7 +59,7 @@ module Fastlane
end
def self.details
"The Fastlane Google Play Store deployment plugin streamlines the build and deployment process to internal, beta, alpha, and production channels, simplifying the process of distributing builds for testing. With its advanced promotion functionality, it also enables easy promotion of builds to higher beta testing phases, helping you get your app to market faster."
"The Fastlane Google Play Store deployment action streamlines the build and deployment process to internal, beta, alpha, and production channels, simplifying the process of distributing builds for testing. With its advanced promotion functionality, it also enables easy promotion of builds to higher beta testing phases, helping you get your app to market faster."
end
def self.available_options
@ -72,6 +72,7 @@ module Fastlane
end
def self.is_supported?(platform)
# Restrict the use of the plugin to Android.
[:android].include?(platform)
end
end

View File

@ -0,0 +1,74 @@
require 'fastlane/action'
require_relative '../helper/android_cd_helper'
module Fastlane
module Actions
class BuildAndDeployAction < Action
def self.run(params)
# Check from parameters
unless Helper::AndroidCdHelper.is_set(params[:from])
UI.error("❌ Parameters from cannot be null")
puts("Error on beta type parameter")
end
unless Helper::AndroidCdHelper.is_set(params[:destination])
UI.error("❌ Parameters destination cannot be null")
puts("Error on beta type parameter")
end
UI.message("⌛️ Promoting to Google Play Store from #{params[:from]} to #{params[:destination]}..")
# Decrypt the keys archive and Extract the keys archive
Helper::AndroidCdHelper.decrypt_android_keys('.')
# Upload the Android App Bundle to the Play Store
Fastlane::Actions.upload_to_play_store(
track: params[:beta_type],
json_key: './service_account_key.json',
skip_upload_apk: true,
skip_upload_aab: true,
skip_upload_metadata: true,
skip_upload_changelogs: true,
skip_upload_images: true,
skip_upload_screenshots: true
)
UI.success('🍺 Successfully promote appbundle to Google Play Store')
end
def self.description
"The Fastlane Google Play Store deployment action streamlines the build and deployment process to internal, beta, alpha, and production channels, simplifying the process of distributing builds for testing. With its advanced promotion functionality, it also enables easy promotion of builds to higher beta testing phases, helping you get your app to market faster."
end
def self.authors
["SAS Wyatt Studio"]
end
def self.return_value
end
def self.details
"The Fastlane Google Play Store deployment action to promote to internal, beta, alpha, and production channels, simplifying the process of distributing builds for testing."
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :from,
env_name: "ANDROID_CD_BETA_FROM",
optional: false,
description: "Actual deployed test (production, beta, alpha, internal)"),
FastlaneCore::ConfigItem.new(key: :destination,
env_name: "ANDROID_CD_BETA_DESTINATION",
optional: false,
description: "Destination of test (production, beta, alpha, internal)")
]
end
def self.is_supported?(platform)
# Restrict the use of the plugin to Android.
[:android].include?(platform)
end
end
end
end

View File

@ -21,6 +21,7 @@ module Fastlane
end
end
# Check if a parameter is set or not
def self.is_set(variable)
str_variable = variable
str_variable = variable.strip if variable.class.to_s == "String"