diff --git a/.ci/android/build.sh b/.ci/android/build.sh index deb36648fc2..727f855d335 100755 --- a/.ci/android/build.sh +++ b/.ci/android/build.sh @@ -9,7 +9,7 @@ ccache -s cd src/android chmod +x ./gradlew -./gradlew bundle${BUILD_FLAVOR}Release ./gradlew assemble${BUILD_FLAVOR}Release +./gradlew bundle${BUILD_FLAVOR}Release ccache -s diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95e420e2685..aa84e67f53d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,6 +132,7 @@ jobs: sudo apt-get install ccache -y - name: Build run: | + git describe --always ./.ci/android/build.sh git status - name: Copy artifacts diff --git a/src/android/app/build.gradle b/src/android/app/build.gradle index 3414c581eb3..9268618fdad 100644 --- a/src/android/app/build.gradle +++ b/src/android/app/build.gradle @@ -140,11 +140,17 @@ def getVersion() { def versionName = '0.0' try { - versionName = 'git describe --always'.execute([], project.rootDir).text - .trim() + versionName = 'git describe --always --long'.execute([], project.rootDir).text + .trim() + .replaceAll(/(-0)?-[^-]+$/, "") } catch (Exception) { logger.error('Cannot find git, defaulting to dummy version number') } + if (System.getenv("GITHUB_ACTIONS") != null) { + def gitTag = System.getenv("GIT_TAG_NAME") + versionName = gitTag ?: versionName + } + return versionName }