From 5f8469dbd71b9de53c305cd00f3995acb24a85d3 Mon Sep 17 00:00:00 2001 From: sds100 Date: Sun, 8 Dec 2024 17:04:00 +0100 Subject: [PATCH] chore: make releasing to production manual in fastlane --- fastlane/Fastfile | 42 +++++++++++++++++++++++++++++------------- fastlane/README.md | 2 +- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index ddf5ef0a2b..52259dcc03 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -23,37 +23,53 @@ lane :testing do end desc "Create and deploy production release" -lane :prod do |options| +lane :prod do version_code = get_properties_value(key: "VERSION_CODE", path: "./app/version.properties") version_name = get_properties_value(key: "VERSION_NAME", path: "./app/version.properties") whats_new = File.read("../app/src/main/assets/whats-new.txt") File.write("metadata/android/en-US/changelogs/" + version_code + ".txt", whats_new) + gradle(task: "testDebugUnitTest") + + github_token = prompt( + text: "Github token: ", + secure_text: true + ) + + ENV["KEYSTORE_PASSWORD"] = prompt( + text: "Key store password: ", + secure_text: true + ) + + ENV["KEY_PASSWORD"] = prompt( + text: "Key password: ", + secure_text: true + ) + # Do not release a debug build for pro version. # gradle(task: "assembleDebug") gradle(task: "assembleProRelease") gradle(task: "bundleProRelease") - apk_path_debug="app/build/outputs/apk/debug/keymapper-" + version_name + "-debug.apk" - apk_path_release="app/build/outputs/apk/release/keymapper-" + version_name + ".apk" - - supply( - aab: "./app/build/outputs/bundle/release/app-release.aab", - track: "beta", - release_status: "draft", - skip_upload_apk: true - ) + apk_path_release="app/build/outputs/apk/pro/release/keymapper-" + version_name + ".apk" github_release = set_github_release( repository_name: "keymapperorg/KeyMapper", - api_bearer: options[:github_token], + api_bearer: github_token, name: version_name, tag_name: "v" + version_name, description: whats_new, commitish: "master", - upload_assets: [apk_path_debug, apk_path_release], + upload_assets: [apk_path_release], is_draft: false, is_prerelease: false ) -end \ No newline at end of file + + supply( + aab: "app/build/outputs/bundle/proRelease/app-pro-release.aab", + track: "beta", + release_status: "draft", + skip_upload_apk: true + ) +end diff --git a/fastlane/README.md b/fastlane/README.md index e799eb9f9e..19f837294e 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -19,7 +19,7 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do [bundle exec] fastlane testing ``` -Create and deploy testing release +Create testing release ### prod