Skip to content

Commit

Permalink
chore: make releasing to production manual in fastlane
Browse files Browse the repository at this point in the history
  • Loading branch information
sds100 committed Dec 8, 2024
1 parent 01d29fd commit 5f8469d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
42 changes: 29 additions & 13 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

supply(
aab: "app/build/outputs/bundle/proRelease/app-pro-release.aab",
track: "beta",
release_status: "draft",
skip_upload_apk: true
)
end
2 changes: 1 addition & 1 deletion fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5f8469d

Please sign in to comment.