From 18ee38526d4da3c58325ba9a03460f0669d82b62 Mon Sep 17 00:00:00 2001 From: Jetsada Machom Date: Thu, 30 May 2024 20:08:06 +0100 Subject: [PATCH] [Github] Update github action to sign apk --- .github/workflows/build-native.yml | 38 ++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-native.yml b/.github/workflows/build-native.yml index 660a5316698..e8aea89a619 100644 --- a/.github/workflows/build-native.yml +++ b/.github/workflows/build-native.yml @@ -280,19 +280,14 @@ jobs: runs-on: ubuntu-22.04 env: + DEBUG: n TARGET: ANDROIDFAT - TARGET_BIN: XCSoar-debug - TARGET_FINAL: XCSoar-debug + TARGET_BIN: XCSoar-release + TARGET_FINAL: XCSoar-release TARGET_EXT: apk NDK: r26d steps: - - name: set vars for push - if: github.event_name == 'push' - run: | - echo "DEBUG=n" >> $GITHUB_ENV - echo "TARGET_FINAL=XCSoar" >> $GITHUB_ENV - - id: checkout uses: actions/checkout@v4 with: @@ -362,6 +357,30 @@ jobs: name: ${{ env.TARGET_FINAL }}-${{ env.git_hash }}.${{ env.TARGET_EXT }} path: output/ANDROID/bin/${{ env.TARGET_BIN }}.${{ env.TARGET_EXT }} + - name: Get Build tools version + shell: bash + run: | + BUILD_TOOLS_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) + echo "BUILD_TOOLS_VERSION=$BUILD_TOOLS_VERSION" >> $GITHUB_ENV + echo Last build tools version is: $BUILD_TOOLS_VERSION + + - uses: r0adkll/sign-android-release@v1.0.4 + name: Sign app APK + id: sign_app + with: + releaseDirectory: output/ANDROID/bin + signingKeyBase64: ${{ secrets.XCSOAR_JET_UPLOAD_KEY_JKS_BASE64 }} + alias: ${{ secrets.ALIAS }} + keyStorePassword: ${{ secrets.XCSOAR_JET_UPLOAD_KEY_JKS_PASSWORD }} + env: + BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOLS_VERSION }} + + - name: upload artifact - signed + uses: actions/upload-artifact@v4 + with: + name: ${{ env.TARGET_FINAL }}-${{ env.git_hash }}-signed.${{ env.TARGET_EXT }} + path: ${{steps.sign_app.outputs.signedReleaseFile}} + - name: Deploy to Staging server if: | github.repository == 'XCSoar/XCSoar' && @@ -541,8 +560,7 @@ jobs: c-ares \ curl \ lua \ - netcdf-cxx \ - libgeotiff + netcdf-cxx - name: Compile XCSoar # We use "-O0" instead of the default "-Og" to work around a