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