Skip to content

Commit

Permalink
Init fastlane files
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Sep 26, 2024
1 parent e40c4c5 commit 490060f
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 14 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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?
}
Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand Down
1 change: 1 addition & 0 deletions fastlane/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
creds.json
2 changes: 2 additions & 0 deletions fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -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
56 changes: 56 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -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
56 changes: 56 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
@@ -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).

0 comments on commit 490060f

Please sign in to comment.