From 814d729ddc2c53eaf3da9cf7dbbcc60fbc933243 Mon Sep 17 00:00:00 2001 From: axiel7 Date: Sun, 11 Aug 2024 09:55:10 +0200 Subject: [PATCH] feat(build): setup builds from develop --- .github/workflows/build-android.yml | 9 ++++++--- app/build.gradle.kts | 12 ++++++++---- version.properties | 2 ++ 3 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 version.properties diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 5a741dfb2..ab2343308 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -2,14 +2,17 @@ name: Android Build APK on: push: - tags: - - '*' + paths: + - 'version.properties' workflow_dispatch: inputs: single_apk: description: 'Build only the universal apk' type: boolean +env: + BRANCH_NAME: ${{ github.base_ref || github.ref_name }} + jobs: build: runs-on: ubuntu-latest @@ -32,7 +35,7 @@ jobs: java-version: 17 distribution: adopt - - if: ${{ inputs.single_apk == true }} + - if: ${{ inputs.single_apk == true || $BRANCH_NAME == 'develop' }} run: sed -i -e '/isEnable/s/true/false/' app/build.gradle.kts - name: Set MAL Client ID diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 06d291e0e..225fd376c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -8,8 +8,12 @@ plugins { id("com.google.devtools.ksp") } -val properties = Properties() -properties.load(project.rootProject.file("private.properties").reader()) +val properties = Properties().also { + it.load(project.rootProject.file("private.properties").reader()) +} +val versionProps = Properties().also { + it.load(project.rootProject.file("version.properties").reader()) +} android { compileSdk = 35 @@ -18,8 +22,8 @@ android { applicationId = "com.axiel7.moelist" minSdk = 23 targetSdk = 35 - versionCode = 146 - versionName = "3.7.1" + versionCode = versionProps.getProperty("code").toInt() + versionName = versionProps.getProperty("name") setProperty("archivesBaseName", "moelist-v$versionName") testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/version.properties b/version.properties new file mode 100644 index 000000000..6fccefff1 --- /dev/null +++ b/version.properties @@ -0,0 +1,2 @@ +code = 146 +name = 3.7.1 \ No newline at end of file