chore: add recommendations extensions and format files

This commit is contained in:
Malo Léon 2023-04-26 09:54:47 +02:00
parent 7c1eb87726
commit 19338d2e04
3 changed files with 16 additions and 13 deletions

5
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"rebornix.ruby"
]
}

View File

@ -5,11 +5,10 @@ module Fastlane
module Actions
class AndroidCdAction < Action
def self.run(params)
# Check parameters
unless Helper::AndroidCdHelper.is_set(params[:beta_type])
UI.error("Parameters beta_type cannot be null")
puts "Error on beta type parameter"
puts("Error on beta type parameter")
end
UI.message("Building and deploying to Google Play Store in #{params[:beta_type]}")
@ -19,20 +18,20 @@ module Fastlane
# Clean the project before building
Fastlane::Actions.gradle(task: "clean")
# Set the build number based on the number of commits
build_number = Fastlane::Actions.number_of_commits()
build_number = Fastlane::Actions.number_of_commits
# Build the Android App Bundle
Fastlane::Actions.gradle(
task: "bundle",
build_type: "Release",
print_command: true,
properties: {
"android.injected.version.code" => build_number,
"android.injected.version.code" => build_number
}
)
# Upload the Android App Bundle to the Play Store
Fastlane::Actions.upload_to_play_store(
track: params[:beta_type],
@ -42,7 +41,7 @@ module Fastlane
skip_upload_images: true,
skip_upload_screenshots: true,
release_status: "draft",
version_code: build_number,
version_code: build_number
)
UI.success('🍺 Successfully build & deploy appbundle to Google Play Store')
@ -68,7 +67,7 @@ module Fastlane
FastlaneCore::ConfigItem.new(key: :beta_type,
env_name: "ANDROID_CD_TEST_TYPE",
optional: false,
description: "Type of test (production, beta, alpha, internal)"),
description: "Type of test (production, beta, alpha, internal)")
]
end

View File

@ -1,10 +1,9 @@
require 'fastlane_core/ui/ui'
module Fastlane
module Helper
module Helper
class AndroidCdHelper
def self.decrypt_android_keys(android_directory)
# Define the GPG command with options
gpg_command = "gpg --quiet --batch --yes --decrypt --passphrase=#{ENV['ANDROID_KEYS_SECRET_PASSPHRASE']} \
--output #{android_directory}/android_keys.zip #{android_directory}/android_keys.zip.gpg"
@ -18,11 +17,11 @@ module Fastlane
# Move the extracted files to the current directory
`jar xvf #{android_directory} && mv #{android_directory}/android_keys/* #{android_directory}`
else
puts "Erreur lors de la décompression du fichier GPG"
puts("Erreur lors de la décompression du fichier GPG")
end
end
def self.is_set variable
def self.is_set(variable)
str_variable = variable
str_variable = variable.strip if variable.class.to_s == "String"
variable && !(str_variable.nil? || str_variable.empty?)