From d1c85210614a6960a3bb59c529b0852d40442b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20St=C3=BCrmer?= Date: Thu, 17 Aug 2023 18:00:06 +0200 Subject: [PATCH] adjust versionCode and versionName for f-droid (#146) --- .github/workflows/continuous-delivery-pipeline.yml | 5 +++++ app/build.gradle.kts | 7 ++++--- fastlane/metadata/android/en-US/short_description.txt | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-delivery-pipeline.yml b/.github/workflows/continuous-delivery-pipeline.yml index 4e91b4e..84c0f11 100644 --- a/.github/workflows/continuous-delivery-pipeline.yml +++ b/.github/workflows/continuous-delivery-pipeline.yml @@ -286,6 +286,11 @@ jobs: fileDir: './' encodedString: ${{ secrets.PLAYSTORE_CREDENTIALS }} + - name: Set versionCode to git count + run: | + export versionCode=$(git rev-list --first-parent --count HEAD) + sed -i -d "s/versionCode = 999/versionCode = $versionCode/g" app/build.gradle.kts + - name: Build release bundle run: | ./gradlew --console=plain -PreleaseKeystore=${{ steps.decode_keystore.outputs.filePath }} -PreleaseStorePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }} -PreleaseKeyAlias=${{ secrets.ANDROID_KEYSTORE_KEY_ALIAS }} -PreleaseKeyPassword=${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }} app:bundle diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6269085..5a694f8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -39,8 +39,9 @@ android { // API 26 | required by: Java 8 Time API minSdk = 26 targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = grgit.log().size - versionName = "0.1.0-${grgit.head().abbreviatedId}" + // versionCode will be set manually on each release + versionCode = 9999 + versionName = "0.1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -63,7 +64,7 @@ android { buildTypes { debug { applicationIdSuffix = ".debug" - versionNameSuffix = "-DEBUG" + versionNameSuffix = "-${grgit.head().abbreviatedId}" isMinifyEnabled = !gradle.startParameter.taskNames.any { it.contains("AndroidTest") } proguardFiles( getDefaultProguardFile("proguard-android.txt"), diff --git a/fastlane/metadata/android/en-US/short_description.txt b/fastlane/metadata/android/en-US/short_description.txt index d4d1ac4..c2c3230 100644 --- a/fastlane/metadata/android/en-US/short_description.txt +++ b/fastlane/metadata/android/en-US/short_description.txt @@ -1 +1 @@ -Photos.network is a privacy first, photo gallery which can be extended by a self-hosted photo storage and sharing service. +Photos.network is a privacy first, photo gallery with an opt self-hosted backend \ No newline at end of file