From f1141a78adb4706c7ee5ecd12e03680a167bc689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Wed, 5 Jul 2023 16:17:24 +0200 Subject: [PATCH 01/11] fix: remove duplacte git_url field --- .../fastlane/plugin/ios_cd/actions/build_and_deploy_action.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/actions/build_and_deploy_action.rb b/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/actions/build_and_deploy_action.rb index 1a31510..6656043 100644 --- a/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/actions/build_and_deploy_action.rb +++ b/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/actions/build_and_deploy_action.rb @@ -105,12 +105,11 @@ module Fastlane git_basic_authorization: Base64.strict_encode64(creds['git_basic_authorization']), keychain_name: creds['temp_keychain_user'].to_s, keychain_password: creds['temp_keychain_password'].to_s, - git_url: creds['git_url'].to_s, username: creds['username'].to_s, team_id: creds['team_id'].to_s, team_name: creds['team_name'].to_s, git_url: creds['git_url'].to_s, - storage_mode: "git" + storage_mode: "git", ) UI.message("👉🏼 App signed") -- 2.47.2 From 385e7c05a91823be65b473579e6ff084d2d4bd70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Wed, 5 Jul 2023 16:38:57 +0200 Subject: [PATCH 02/11] refactor: move some fn in helper class --- .../ios_cd/actions/build_and_deploy_action.rb | 32 +++++++------------ .../plugin/ios_cd/helper/ios_cd_helper.rb | 22 +++++++++++++ 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/actions/build_and_deploy_action.rb b/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/actions/build_and_deploy_action.rb index 6656043..972175d 100644 --- a/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/actions/build_and_deploy_action.rb +++ b/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/actions/build_and_deploy_action.rb @@ -21,25 +21,19 @@ module Fastlane # Decrypt the keys archive and Extract the keys archive Helper::IosCdHelper.decrypt_ios_keys('.') - UI.message("👉🏼 Credentials decrypted.") + UI.message("🍺 Credentials decrypted.") # Retrieve credentials creds = Helper::IosCdHelper.parse_ios_credentials('.') - UI.message("👉🏼 Credentials parsed.") + UI.message("🍺 Credentials parsed.") # Delete decrypted artifacts artifacts = ['ios_keys.zip', 'ios_credentials.json'] - artifacts.each do |file| - File.delete(file) if File.exist?(file) - end + Helper::IosCdHelper.delete_artifacts(artifacts) # Check credentials required_fields = ['developer_app_id', 'username', 'developer_app_identifier', 'app_identifier_extensions', 'apple_issuer_id', 'apple_key_id', 'team_id', 'team_name', 'apple_key_content', 'git_url', 'git_basic_authorization', 'provisioning_profiles', 'temp_keychain_user', 'temp_keychain_password'] - missing_fields = required_fields - creds.keys - - unless missing_fields.empty? - raise ArgumentError, "❌ missing keys in credential json file : #{missing_fields}" - end + Helper::IosCdHelper.check_required_fields(required_fields, creds.keys) # Delete keychain if existing if File.exist?(File.expand_path("~/Library/Keychains/#{name}-db")) @@ -55,7 +49,7 @@ module Fastlane unlock: false, timeout: 0 ) - UI.message("👉🏼 New keychain created") + UI.message("🍺 New keychain created") # Obtain App Store Connect API key api_key = other_action.app_store_connect_api_key( @@ -65,7 +59,7 @@ module Fastlane duration: 500, in_house: false ) - UI.message("👉🏼 API Key formated") + UI.message("🍺 API Key formated") last_testflight_build_number = other_action.latest_testflight_build_number( @@ -82,7 +76,7 @@ module Fastlane build_number: last_testflight_build_number, xcodeproj: "Runner.xcodeproj" ) - UI.message("👉🏼 Build number incremented") + UI.message("🍺 Build number incremented") # Install Cocoapods other_action.cocoapods( @@ -91,7 +85,7 @@ module Fastlane integrate: true, podfile: "./Podfile" ) - UI.message("👉🏼 Pod got") + UI.message("🍺 Pod got") # Set up code signing using match # Configures and runs `match` which manages code signing certificates and provisioning profiles for the project. @@ -109,9 +103,9 @@ module Fastlane team_id: creds['team_id'].to_s, team_name: creds['team_name'].to_s, git_url: creds['git_url'].to_s, - storage_mode: "git", + storage_mode: "git" ) - UI.message("👉🏼 App signed") + UI.message("🍺 App signed") # Build and export app using Gym # Builds and packages an iOS app or framework for distribution to the App Store, TestFlight, or Enterprise distribution. @@ -123,7 +117,7 @@ module Fastlane provisioningProfiles: creds['provisioning_profiles'] } ) - UI.message("👉🏼 App built") + UI.message("🍺 App built") # Upload build to App Store Connect using Pilot other_action.pilot( @@ -146,9 +140,7 @@ module Fastlane # Delete build artifacts artifacts = ['Runner.app.dSYM.zip', 'Runner.ipa'] - artifacts.each do |file| - File.delete(file) if File.exist?(file) - end + Helper::IosCdHelper.delete_artifacts(artifacts) end def self.description diff --git a/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/helper/ios_cd_helper.rb b/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/helper/ios_cd_helper.rb index 939f5cf..24178ad 100644 --- a/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/helper/ios_cd_helper.rb +++ b/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/helper/ios_cd_helper.rb @@ -41,6 +41,28 @@ module Fastlane UI.user_error!("❌ Ios credentials doesn't exist") puts("json file doesn't exist") end + + def self.check_required_fields(required_fields, json) + missing_fields = required_fields - json + + unless missing_fields.empty? + raise ArgumentError, "❌ missing keys in credential json file : #{missing_fields}" + end + end + + def self.check_environment_variables(variables) + variables.each do |variable| + unless ENV.key?(variable) + raise "❌ The environment variable '#{variable}' is not defined." + end + end + end + + def self.delete_artifacts(artifacts) + artifacts.each do |file| + File.delete(file) if File.exist?(file) + end + end end end end -- 2.47.2 From 289802d9bcb997e7889f3782ed78fc084364f193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Wed, 5 Jul 2023 16:40:45 +0200 Subject: [PATCH 03/11] docs: add some comments --- .../plugin/ios_cd/helper/ios_cd_helper.rb | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/helper/ios_cd_helper.rb b/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/helper/ios_cd_helper.rb index 24178ad..e7b2ccf 100644 --- a/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/helper/ios_cd_helper.rb +++ b/plugins/fastlane-plugin-ios_cd/lib/fastlane/plugin/ios_cd/helper/ios_cd_helper.rb @@ -41,27 +41,30 @@ module Fastlane UI.user_error!("❌ Ios credentials doesn't exist") puts("json file doesn't exist") end + end - def self.check_required_fields(required_fields, json) - missing_fields = required_fields - json + # Check json fields + def self.check_required_fields(required_fields, json) + missing_fields = required_fields - json - unless missing_fields.empty? - raise ArgumentError, "❌ missing keys in credential json file : #{missing_fields}" + unless missing_fields.empty? + raise ArgumentError, "❌ missing keys in credential json file : #{missing_fields}" + end + end + + # Check if set of environment variables are defined + def self.check_environment_variables(variables) + variables.each do |variable| + unless ENV.key?(variable) + raise "❌ The environment variable '#{variable}' is not defined." end end + end - def self.check_environment_variables(variables) - variables.each do |variable| - unless ENV.key?(variable) - raise "❌ The environment variable '#{variable}' is not defined." - end - end - end - - def self.delete_artifacts(artifacts) - artifacts.each do |file| - File.delete(file) if File.exist?(file) - end + # Delete built files + def self.delete_artifacts(artifacts) + artifacts.each do |file| + File.delete(file) if File.exist?(file) end end end -- 2.47.2 From 4021345e0a4148a18ca1d1999eaf641ac527da55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Wed, 5 Jul 2023 16:46:45 +0200 Subject: [PATCH 04/11] refactor: move delete artifacts fn in helper for android lane --- .../plugin/android_cd/actions/build_and_deploy_action.rb | 4 +--- .../fastlane/plugin/android_cd/helper/android_cd_helper.rb | 7 +++++++ 2 files changed, 8 insertions(+), 3 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 9117249..84252e1 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 @@ -50,9 +50,7 @@ module Fastlane # Delete artifacts files artifacts = ['android_keys.zip', 'key.jks', 'key.properties', 'service_account_key.json'] - artifacts.each do |file| - File.delete(file) if File.exist?(file) - end + Helper::AndroidCdHelper.delete_artifacts(artifacts) UI.success('🍺 Successfully build & deploy appbundle to Google Play Store') end diff --git a/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/helper/android_cd_helper.rb b/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/helper/android_cd_helper.rb index 619583e..02d22f0 100644 --- a/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/helper/android_cd_helper.rb +++ b/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/helper/android_cd_helper.rb @@ -26,6 +26,13 @@ module Fastlane str_variable = variable.strip if variable.class.to_s == "String" variable && !(str_variable.nil? || str_variable.empty?) end + + # Delete built files + def self.delete_artifacts(artifacts) + artifacts.each do |file| + File.delete(file) if File.exist?(file) + end + end end end end -- 2.47.2 From fef6c757383363f5ef4f77a526a65898a35815d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Tue, 11 Jul 2023 15:29:19 +0200 Subject: [PATCH 05/11] fix: use flutter_build action instead of gradle action (#25) --- .../android_cd/actions/build_and_deploy_action.rb | 13 ++----------- 1 file changed, 2 insertions(+), 11 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 84252e1..07001be 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 @@ -20,18 +20,9 @@ module Fastlane # Clean the project before building other_action.gradle(task: "clean") - # Set the build number based on the number of commits - build_number = other_action.number_of_commits - # Build the Android App Bundle - other_action.gradle( - task: "bundle", - build_type: "Release", - print_command: true, - project_dir: './', - properties: { - "android.injected.version.code" => build_number - } + other_action.flutter_build( + build: 'appbundle' ) UI.message("👉🏼 App built") -- 2.47.2 From 1ef8fc00e7935d41ce01f16f08b33009f3f81b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Tue, 11 Jul 2023 15:45:34 +0200 Subject: [PATCH 06/11] wip: temporary remove upload to tetflight action --- .../actions/build_and_deploy_action.rb | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 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 07001be..442d5fa 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 @@ -28,16 +28,16 @@ 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", - version_code: build_number - ) + # 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", + # version_code: build_number + # ) # Delete artifacts files artifacts = ['android_keys.zip', 'key.jks', 'key.properties', 'service_account_key.json'] -- 2.47.2 From b307d8110a1f1cdd929329b9c7a35cd45c0856e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Tue, 11 Jul 2023 15:52:27 +0200 Subject: [PATCH 07/11] remove all actions linked to gradle --- .../plugin/android_cd/actions/build_and_deploy_action.rb | 4 ---- 1 file changed, 4 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 442d5fa..a50c71d 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 @@ -14,12 +14,8 @@ module Fastlane # Decrypt the keys archive and Extract the keys archive Helper::AndroidCdHelper.decrypt_android_keys('.') - UI.message("👉🏼 Credentials decrypted") - # Clean the project before building - other_action.gradle(task: "clean") - # Build the Android App Bundle other_action.flutter_build( build: 'appbundle' -- 2.47.2 From 53e512462bb95ac6f665ff6260dffe71b4c8980a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Tue, 11 Jul 2023 15:59:16 +0200 Subject: [PATCH 08/11] feat: remove comments on android pipeline to upload build --- .../actions/build_and_deploy_action.rb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 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 a50c71d..72518a8 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 @@ -24,16 +24,15 @@ 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", - # version_code: build_number - # ) + 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" + ) # Delete artifacts files artifacts = ['android_keys.zip', 'key.jks', 'key.properties', 'service_account_key.json'] -- 2.47.2 From bc848e09ec0a80bea5630dac0367eea4e4295be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Wed, 12 Jul 2023 08:41:49 +0200 Subject: [PATCH 09/11] feat: move aab release_status from draft to completed --- .../plugin/android_cd/actions/build_and_deploy_action.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 72518a8..a3f302c 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 @@ -31,7 +31,7 @@ module Fastlane skip_upload_metadata: true, skip_upload_images: true, skip_upload_screenshots: true, - release_status: "draft" + release_status: "completed" ) # Delete artifacts files -- 2.47.2 From 4cca8ef739d420a964b6bfebbc6a99c922d2106f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Thu, 27 Jul 2023 10:55:32 +0200 Subject: [PATCH 10/11] fix: rollback to draft status --- .../plugin/android_cd/actions/build_and_deploy_action.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a3f302c..72518a8 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 @@ -31,7 +31,7 @@ module Fastlane skip_upload_metadata: true, skip_upload_images: true, skip_upload_screenshots: true, - release_status: "completed" + release_status: "draft" ) # Delete artifacts files -- 2.47.2 From 9e56b4127e3e5a46984af158b7834e86b17f4e21 Mon Sep 17 00:00:00 2001 From: Hugo Pointcheval Date: Tue, 8 Aug 2023 17:51:26 +0200 Subject: [PATCH 11/11] docs: add jar documentation to zip file in a format fastlane can understand --- plugins/fastlane-plugin-android_cd/README.md | 54 ++++++++++++-------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/plugins/fastlane-plugin-android_cd/README.md b/plugins/fastlane-plugin-android_cd/README.md index 92fba53..05cd7d2 100644 --- a/plugins/fastlane-plugin-android_cd/README.md +++ b/plugins/fastlane-plugin-android_cd/README.md @@ -4,7 +4,7 @@ ## Getting Started -This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-android_cd`, add the dependencies into your `PluginFile` : +This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-android_cd` , add the dependencies into your `PluginFile` : ```ruby gem "fastlane-plugin-android_cd", git: "https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-fastlane-plugins.git", branch: "main", glob: 'plugins/fastlane-plugin-android_cd/*.gemspec' @@ -22,7 +22,7 @@ To use these actions, you need to add some information to your Android folder so In your android folder, place a compressed folder containing: -- The application's signing key (in the .jks format). If this is a new application, you can generate this key with the following command: +* The application's signing key (in the .jks format). If this is a new application, you can generate this key with the following command: ```shel keytool -genkey -v -keystore key_store_name.keystore -alias key_alias_name -keyalg RSA -keysize 2048 -validity 10000 @@ -30,29 +30,39 @@ keytool -genkey -v -keystore key_store_name.keystore -alias key_alias_name -keya During the execution of the above command, you will be prompted to provide a password for your key. Make sure to remember this password, as you will need it later. -- The key.properties file containing sensitive data for using the signing key, such as the path of the key or the password. If this file does not exist yet, create it and fill in the following fields: +* The key.properties file containing sensitive data for using the signing key, such as the path of the key or the password. If this file does not exist yet, create it and fill in the following fields: - - `storeFile`: the relative or absolute path to the key storage file that contains the private key used to sign the Android application. - - `storePassword`: the password used to access the key storage file. - - `keyAlias`: the alias of the key used to sign the application. - - `keyPassword`: the password used to access the key. + + `storeFile`: the relative or absolute path to the key storage file that contains the private key used to sign the Android application. + + `storePassword`: the password used to access the key storage file. + + `keyAlias`: the alias of the key used to sign the application. + + `keyPassword`: the password used to access the key. -- The credentials in JSON format to allow the fastlane action to connect to the Google Play Store console and upload the new build. To retrieve them, follow these steps: +* The credentials in JSON format to allow the fastlane action to connect to the Google Play Store console and upload the new build. To retrieve them, follow these steps: - - Go to your Google Play Store console. - - In the Settings menu, select `API access`, then click `Create Service Account` - - Navigate to the provided Google Developers Console link in the dialog - - Click `Create Service Account` at the top of the Google Developers Console - - Provide the required details, then click `Create` - - Click `Select a role`, select `Service Accounts`, then click `Service Account User` - - In the Service Accounts dashboard, navigate to the Actions column, tap the menu for the service account that you created, then click `Create Key` - - Select JSON as the key type, then click `Save` - - Back on the Google Play Console, click `Done` to close the dialog - - Click on `Grant Access` for the newly added service account - - Make sure that the role of this service account has the permission to upload builds - - Click `Add User` to close the dialog + + Go to your Google Play Store console. + + In the Settings menu, select `API access`, then click `Create Service Account` + + Navigate to the provided Google Developers Console link in the dialog + + Click `Create Service Account` at the top of the Google Developers Console + + Provide the required details, then click `Create` + + Click `Select a role`, select `Service Accounts`, then click `Service Account User` + + In the Service Accounts dashboard, navigate to the Actions column, tap the menu for the service account that you created, then click `Create Key` + + Select JSON as the key type, then click `Save` + + Back on the Google Play Console, click `Done` to close the dialog + + Click on `Grant Access` for the newly added service account + + Make sure that the role of this service account has the permission to upload builds + + Click `Add User` to close the dialog -Once you have all three elements in your folder, it's time to encrypt them. Indeed, this folder contains elements that are too sensitive to be referenced on git. Compress the folder, place the compressed folder in the android folder of your Flutter project, and execute the following command: +Once you have all three elements in your folder, it's time to encrypt them. Indeed, this folder contains elements that are too sensitive to be referenced on git. + +Place them in a folder named `android_keys` and compress it using the following command: + +```shell +jar cfvM android_keys.zip android_keys +``` + +> The plugin will use `jar xvf android/android_keys.zip && mv android/android_keys/* android/` to extract the secret files. + +Then, encrypt the compressed folder using GPG. ```shell gpg --quiet --batch --yes --symmetric --passphrase="" --output android/android_keys.zip.gpg android/android_keys.zip @@ -74,7 +84,7 @@ build_and_deploy(beta_type: "internal") promote(from: "internal", destination: "beta") ``` -note that beta type can be `production`, `beta`, `alpha`, `internal`. +note that beta type can be `production` , `beta` , `alpha` , `internal` . ## Run tests for this plugin -- 2.47.2