From 20356e0a26e63c934029a6b22ac74a9f9140bf6b Mon Sep 17 00:00:00 2001 From: DHD2280 Date: Wed, 4 Dec 2024 22:49:18 +0100 Subject: [PATCH] Build debug script improvement --- .github/workflows/build_debug.yml | 2 +- app/build.gradle.kts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_debug.yml b/.github/workflows/build_debug.yml index ed85d78..9c6506a 100644 --- a/.github/workflows/build_debug.yml +++ b/.github/workflows/build_debug.yml @@ -23,7 +23,7 @@ jobs: run: chmod +x gradlew - name: Get application version name - run: echo "VERSION_NAME=$(($(cat app/build.gradle.kts | grep versionCode | tr -s ' ' | cut -d " " -f 4 | tr -d '\r')))" >> $GITHUB_ENV + run: echo "VERSION_NAME=$(${{github.workspace}}/gradlew -q printVersionName)" >> $GITHUB_ENV - name: Bump application version code uses: chkfung/android-version-actions@v1.2.3 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 59b21e3..d37ef24 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -143,4 +143,8 @@ dependencies { // Media 3 implementation(libs.androidx.media3.exoplayer) implementation (libs.androidx.media3.common) +} + +tasks.register("printVersionName") { + println(android.defaultConfig.versionName?.replace(".debug".toRegex(), "")) } \ No newline at end of file