From cf5fbc65b352492048250e8c7f24eb5b480c000d Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Mon, 8 Apr 2024 11:49:43 +0100 Subject: [PATCH] Split build/release triggering --- .github/workflows/build.yml | 31 ------------------------------- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c04b60f0..0656cbc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,5 @@ name: build on: - release: - types: [created] push: branches: - "**" @@ -9,7 +7,6 @@ on: jobs: build: runs-on: ubuntu-latest - if: github.event_name != 'release' permissions: contents: read steps: @@ -23,31 +20,3 @@ jobs: name: build path: ./app/build/outputs/apk/debug/*.apk retention-days: 3 - release: - if: github.event_name == 'release' - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV - - run: echo "SIGNING_STORE_FILE=$RUNNER_TEMP/keystore.jks" >> $GITHUB_ENV - - run: printenv SIGNING_STORE_FILE_BASE64 | base64 -d > "$SIGNING_STORE_FILE" - env: - SIGNING_STORE_FILE_BASE64: ${{ secrets.ANDROID_SIGNING_STORE_FILE_BASE64 }} - - run: ./gradlew --no-daemon :app:assembleRelease :app:bundleRelease - env: - SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }} - SIGNING_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }} - SIGNING_KEY_ALIAS: upload - - run: rm "$SIGNING_STORE_FILE" - - uses: microbit-foundation/upload-release-action@2.9.0 - with: - file: app/build/outputs/apk/bundle/app-bundle.aab - asset_name: microbit-bundle-${{ env.TAG }}.aab - - uses: microbit-foundation/upload-release-action@2.9.0 - with: - file: app/build/outputs/apk/release/app-release.apk - asset_name: microbit-release-${{ env.TAG }}.apk diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..2a20172b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: build +on: + release: + types: [created] + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV + - run: echo "SIGNING_STORE_FILE=$RUNNER_TEMP/keystore.jks" >> $GITHUB_ENV + - run: printenv SIGNING_STORE_FILE_BASE64 | base64 -d > "$SIGNING_STORE_FILE" + env: + SIGNING_STORE_FILE_BASE64: ${{ secrets.ANDROID_SIGNING_STORE_FILE_BASE64 }} + - run: ./gradlew --no-daemon :app:assembleRelease :app:bundleRelease + env: + SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }} + SIGNING_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }} + SIGNING_KEY_ALIAS: upload + - run: rm "$SIGNING_STORE_FILE" + - uses: microbit-foundation/upload-release-action@2.9.0 + with: + file: app/build/outputs/apk/bundle/app-bundle.aab + asset_name: microbit-bundle-${{ env.TAG }}.aab + - uses: microbit-foundation/upload-release-action@2.9.0 + with: + file: app/build/outputs/apk/release/app-release.apk + asset_name: microbit-release-${{ env.TAG }}.apk