From 490060fe059514d2360f2323ff02321bc023e8c2 Mon Sep 17 00:00:00 2001 From: nift4 Date: Thu, 26 Sep 2024 11:36:21 +0200 Subject: [PATCH] Init fastlane files --- .gitignore | 11 +++++++++ app/build.gradle.kts | 19 +++++++++++---- fastlane/.gitignore | 1 + fastlane/Appfile | 2 ++ fastlane/Fastfile | 56 ++++++++++++++++++++++++++++++++++++++++++++ fastlane/README.md | 56 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 140 insertions(+), 5 deletions(-) create mode 100644 fastlane/.gitignore create mode 100644 fastlane/Appfile create mode 100644 fastlane/Fastfile create mode 100644 fastlane/README.md diff --git a/.gitignore b/.gitignore index 0c420c28..7ef9562c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,14 @@ .externalNativeBuild .cxx local.properties +# fastlane specific +**/fastlane/report.xml + +# deliver temporary files +**/fastlane/Preview.html + +# snapshot generated screenshots +**/fastlane/screenshots + +# scan temporary files +**/fastlane/test_output diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1bca18bd..f9ca970d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -34,6 +34,14 @@ android { keyPassword = project.properties["AKANE_RELEASE_KEY_PASSWORD"].toString() } } + create("release2") { + if (project.hasProperty("AKANE2_RELEASE_KEY_ALIAS")) { + storeFile = file(project.properties["AKANE2_RELEASE_STORE_FILE"].toString()) + storePassword = project.properties["AKANE2_RELEASE_STORE_PASSWORD"].toString() + keyAlias = project.properties["AKANE2_RELEASE_KEY_ALIAS"].toString() + keyPassword = project.properties["AKANE2_RELEASE_KEY_PASSWORD"].toString() + } + } } androidResources { @@ -186,8 +194,9 @@ android { vcsInfo { include = false } - if (project.hasProperty("AKANE_RELEASE_KEY_ALIAS")) { - signingConfig = signingConfigs["release"] + if (project.hasProperty("AKANE_RELEASE_KEY_ALIAS") || project.hasProperty("signing2")) { + signingConfig = signingConfigs[if (project.hasProperty("signing2")) + "release2" else "release"] } isCrunchPngs = false // for reproducible builds TODO how much size impact does this have? where are the pngs from? can we use webp? } @@ -233,14 +242,14 @@ dependencies { val media3Version = "1.4.1" implementation("androidx.activity:activity-ktx:1.9.2") implementation("androidx.appcompat:appcompat:1.7.0") - implementation("androidx.collection:collection-ktx:1.4.3") + implementation("androidx.collection:collection-ktx:1.4.4") implementation("androidx.concurrent:concurrent-futures-ktx:1.2.0") implementation("androidx.constraintlayout:constraintlayout:2.2.0-beta01") implementation("androidx.core:core-ktx:1.13.1") implementation("androidx.core:core-splashscreen:1.0.1") //implementation("androidx.datastore:datastore-preferences:1.1.0-rc01") TODO don't abuse shared prefs implementation("androidx.fragment:fragment-ktx:1.8.3") - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.5") + implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.6") implementation("androidx.media3:media3-exoplayer:$media3Version") implementation("androidx.media3:media3-exoplayer-midi:$media3Version") implementation("androidx.media3:media3-session:$media3Version") @@ -255,7 +264,7 @@ dependencies { implementation("io.coil-kt.coil3:coil:3.0.0-alpha10") //noinspection GradleDependency newer versions need java.nio which is api 26+ //implementation("com.github.albfernandez:juniversalchardet:2.0.3") TODO - implementation("androidx.profileinstaller:profileinstaller:1.3.1") + implementation("androidx.profileinstaller:profileinstaller:1.4.0") "baselineProfile"(project(":baselineprofile")) // --- below does not apply to release builds --- debugImplementation("com.squareup.leakcanary:leakcanary-android:2.14") diff --git a/fastlane/.gitignore b/fastlane/.gitignore new file mode 100644 index 00000000..efc99e03 --- /dev/null +++ b/fastlane/.gitignore @@ -0,0 +1 @@ +creds.json diff --git a/fastlane/Appfile b/fastlane/Appfile new file mode 100644 index 00000000..10befddd --- /dev/null +++ b/fastlane/Appfile @@ -0,0 +1,2 @@ +json_key_file("fastlane/creds.json") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one +package_name("org.akanework.gramophone") # e.g. com.krausefx.app diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 00000000..3279674f --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,56 @@ +# This file contains the fastlane.tools configuration +# You can find the documentation at https://docs.fastlane.tools +# +# For a list of all available actions, check out +# +# https://docs.fastlane.tools/actions +# +# For a list of all available plugins, check out +# +# https://docs.fastlane.tools/plugins/available-plugins +# +opt_out_usage +default_platform(:android) + +platform :android do + def ensure_git_ok() + ensure_git_branch(branch: "beta") + ensure_git_status_clean + end + def gradle_reproducible(task, system_properties={}) + gradle(flags: "--no-configuration-cache --no-build-cache --no-daemon", + system_properties: system_properties, + tasks: ["clean", task]) + end + + desc "Runs all the tests" + lane :test do + gradle(task: "test") + end + + desc "Deploy a new version to the Google Play" + lane :googleplay do + ensure_git_ok + gradle_reproducible(system_properties: {"signing2": "true"}, + task: "assembleRelease") + upload_to_play_store(release_status: "draft", track: "alpha") + end + + desc "Build release" + lane :buildrel do + ensure_git_ok + + gradle_reproducible(task: "assembleRelease") + end + + desc "Prepare release" + lane :preprel do + ensure_git_ok + # TODO bump version number + changelog = prompt(text: "Changelog") + # TODO save changelog to disk + # TODO git commit + buildrel + # TODO create draft(?) release on gh + end +end diff --git a/fastlane/README.md b/fastlane/README.md new file mode 100644 index 00000000..6a95962c --- /dev/null +++ b/fastlane/README.md @@ -0,0 +1,56 @@ +fastlane documentation +---- + +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +```sh +xcode-select --install +``` + +For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) + +# Available Actions + +## Android + +### android test + +```sh +[bundle exec] fastlane android test +``` + +Runs all the tests + +### android googleplay + +```sh +[bundle exec] fastlane android googleplay +``` + +Deploy a new version to the Google Play + +### android buildrel + +```sh +[bundle exec] fastlane android buildrel +``` + +Build release + +### android preprel + +```sh +[bundle exec] fastlane android preprel +``` + +Prepare release + +---- + +This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. + +More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). + +The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).