From 5d9ee95a5b32647f47676a50ee7cc66f8d8be055 Mon Sep 17 00:00:00 2001 From: Victor Andreasson Date: Thu, 1 Feb 2024 19:29:23 +0100 Subject: [PATCH] Github Actions: Always use the latest Android build tools Taken from https://github.com/r0adkll/sign-android-release/issues/84#issuecomment-1889636075. --- .github/workflows/prerelease.yml | 11 +++++++++++ .github/workflows/release.yml | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 901b9b58e..9fd52c1f1 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -25,6 +25,13 @@ jobs: distribution: 'zulu' java-version: '11' + - name: Setup build tool version variable + shell: bash + run: | + BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) + echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV + echo Last build tool version is: $BUILD_TOOL_VERSION + # Build the standard version binary. - name: Generate "premium" release APK run: ./gradlew assemblePremiumRelease --stacktrace @@ -37,6 +44,8 @@ jobs: signingKeyBase64: ${{ secrets.APK_SIGNING_KEYSTORE_FILE }} alias: orgzly-revived-20231013 keyStorePassword: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }} + env: + BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} - name: Get version name from git tag run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV @@ -56,6 +65,8 @@ jobs: signingKeyBase64: ${{ secrets.APK_SIGNING_KEYSTORE_FILE }} alias: orgzly-revived-20231013 keyStorePassword: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }} + env: + BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} - name: Rename APK file run: mv ${{steps.sign_fdroid_apk.outputs.signedReleaseFile}} orgzly-revived-fdroid-${{ env.VERSION }}.apk diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 521634c57..1ff4e75f8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,13 @@ jobs: distribution: 'zulu' java-version: '11' + - name: Setup build tool version variable + shell: bash + run: | + BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) + echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV + echo Last build tool version is: $BUILD_TOOL_VERSION + # Build the standard version binary. - name: Generate "premium" release APK run: ./gradlew assemblePremiumRelease --stacktrace @@ -38,6 +45,8 @@ jobs: signingKeyBase64: ${{ secrets.APK_SIGNING_KEYSTORE_FILE }} alias: orgzly-revived-20231013 keyStorePassword: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }} + env: + BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} - name: Get version name from git tag run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV @@ -57,6 +66,8 @@ jobs: signingKeyBase64: ${{ secrets.APK_SIGNING_KEYSTORE_FILE }} alias: orgzly-revived-20231013 keyStorePassword: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }} + env: + BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} - name: Rename APK file run: mv ${{steps.sign_fdroid_apk.outputs.signedReleaseFile}} orgzly-revived-fdroid-${{ env.VERSION }}.apk @@ -67,4 +78,3 @@ jobs: with: files: 'orgzly-revived-*.apk' draft: true - \ No newline at end of file