From 2c98a87298162ec637ca5bbb31e781e2e2ed5ae7 Mon Sep 17 00:00:00 2001 From: Abhijit Valluri Date: Sun, 11 Oct 2020 23:26:51 +0100 Subject: [PATCH] Update CI actions to remove deprecated set-env, new apk signing action Removing set-env due to the vunerability mentioned by Github here: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ --- .../comment-on-pr.yml | 2 +- .github/workflows/android-build-pr.yml | 30 +------------------ .github/workflows/android-build.yml | 24 +++++++++++++-- .github/workflows/release-automation.yml | 6 ++-- 4 files changed, 26 insertions(+), 36 deletions(-) rename .github/{workflows => disabled_workflows}/comment-on-pr.yml (85%) diff --git a/.github/workflows/comment-on-pr.yml b/.github/disabled_workflows/comment-on-pr.yml similarity index 85% rename from .github/workflows/comment-on-pr.yml rename to .github/disabled_workflows/comment-on-pr.yml index 16aeb8e31..9cb1ff193 100644 --- a/.github/workflows/comment-on-pr.yml +++ b/.github/disabled_workflows/comment-on-pr.yml @@ -4,7 +4,7 @@ on: types: [opened] branches: - fork -jobs: +jobs: # Disabled because we cannot build changes from fork PRs using this repo's secrets due to Github limitations. So, the built apk will be from wrong code, so this is pointless. comment-on-pr: runs-on: ubuntu-latest if: "! contains(toJSON(github.event.pull_request.title), '[skip ci]')" diff --git a/.github/workflows/android-build-pr.yml b/.github/workflows/android-build-pr.yml index 70e0925dc..2c5f9175c 100644 --- a/.github/workflows/android-build-pr.yml +++ b/.github/workflows/android-build-pr.yml @@ -17,7 +17,7 @@ jobs: with: java-version: 11 - name: Create version name - run: echo "::set-env name=VERSION_NAME::$(git describe --tags HEAD)" + run: echo "VERSION_NAME=$(git describe --tags HEAD)" >> $GITHUB_ENV - name: Build forkRelease variant of app uses: eskatos/gradle-command-action@v1 with: @@ -25,34 +25,6 @@ jobs: dependencies-cache-enabled: true configuration-cache-enabled: true arguments: assembleForkRelease -PversionName=${{ env.VERSION_NAME }} - - name: Create signed APKs - uses: abhijitvalluri/sign-apks@v0.6 - with: - releaseDirectory: app/build/outputs/apk/forkRelease/ - signingKeyBase64: ${{ secrets.DEBUG_SIGNING_KEY }} - alias: ${{ secrets.DEBUG_ALIAS }} - keyStorePassword: ${{ secrets.DEBUG_KEY_STORE_PASSWORD }} - keyPassword: ${{ secrets.DEBUG_KEY_PASSWORD }} - - name: Archive arm64 apk - uses: actions/upload-artifact@v2 - with: - name: app-arm64-v8a-forkRelease.apk - path: app/build/outputs/apk/forkRelease/app-arm64-v8a-forkRelease.apk - - name: Archive armeabi apk - uses: actions/upload-artifact@v2 - with: - name: app-armeabi-v7a-forkRelease.apk - path: app/build/outputs/apk/forkRelease/app-armeabi-v7a-forkRelease.apk - - name: Archive x86 apk - uses: actions/upload-artifact@v2 - with: - name: app-x86-forkRelease.apk - path: app/build/outputs/apk/forkRelease/app-x86-forkRelease.apk - - name: Archive x86_64 apk - uses: actions/upload-artifact@v2 - with: - name: app-x86_64-forkRelease.apk - path: app/build/outputs/apk/forkRelease/app-x86_64-forkRelease.apk run-testDebug: diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index ad7b886f3..dffdd9b51 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -17,7 +17,7 @@ jobs: with: java-version: 11 - name: Create version name - run: echo "::set-env name=VERSION_NAME::$(git describe --tags HEAD)" + run: echo "VERSION_NAME=$(git describe --tags HEAD)" >> $GITHUB_ENV - name: Build forkRelease variant of app uses: eskatos/gradle-command-action@v1 with: @@ -26,13 +26,33 @@ jobs: configuration-cache-enabled: true arguments: assembleForkRelease -PversionName=${{ env.VERSION_NAME }} - name: Create signed APKs - uses: abhijitvalluri/sign-apks@v0.6 + uses: abhijitvalluri/sign-apks@v0.8 with: releaseDirectory: app/build/outputs/apk/forkRelease/ signingKeyBase64: ${{ secrets.DEBUG_SIGNING_KEY }} alias: ${{ secrets.DEBUG_ALIAS }} keyStorePassword: ${{ secrets.DEBUG_KEY_STORE_PASSWORD }} keyPassword: ${{ secrets.DEBUG_KEY_PASSWORD }} + - name: Archive arm64 apk + uses: actions/upload-artifact@v2 + with: + name: app-arm64-v8a-forkRelease.apk + path: app/build/outputs/apk/forkRelease/app-arm64-v8a-forkRelease.apk + - name: Archive armeabi apk + uses: actions/upload-artifact@v2 + with: + name: app-armeabi-v7a-forkRelease.apk + path: app/build/outputs/apk/forkRelease/app-armeabi-v7a-forkRelease.apk + - name: Archive x86 apk + uses: actions/upload-artifact@v2 + with: + name: app-x86-forkRelease.apk + path: app/build/outputs/apk/forkRelease/app-x86-forkRelease.apk + - name: Archive x86_64 apk + uses: actions/upload-artifact@v2 + with: + name: app-x86_64-forkRelease.apk + path: app/build/outputs/apk/forkRelease/app-x86_64-forkRelease.apk run-testDebug: diff --git a/.github/workflows/release-automation.yml b/.github/workflows/release-automation.yml index 3689c13a3..03505fefa 100644 --- a/.github/workflows/release-automation.yml +++ b/.github/workflows/release-automation.yml @@ -15,17 +15,15 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 - - name: Create version name - run: echo "::set-env name=VERSION_NAME::$(git describe --tags HEAD)" - name: Build forkRelease variant of app uses: eskatos/gradle-command-action@v1 with: wrapper-cache-enabled: true dependencies-cache-enabled: true configuration-cache-enabled: true - arguments: assembleForkRelease -PversionName=${{ env.VERSION_NAME }} + arguments: assembleForkRelease -PversionName=${{ github.event.ref }} - name: Create signed APKs - uses: abhijitvalluri/sign-apks@v0.6 + uses: abhijitvalluri/sign-apks@v0.8 with: releaseDirectory: app/build/outputs/apk/forkRelease/ signingKeyBase64: ${{ secrets.DEBUG_SIGNING_KEY }}