From 9a19697e122f18479f5c2253e91f80b952948ea0 Mon Sep 17 00:00:00 2001 From: Aleksey Ivanovsky Date: Sun, 21 Jul 2024 21:19:24 +0200 Subject: [PATCH] Add matrix to pipeline --- .github/workflows/pipeline.yml | 221 ++++++++++++++++++--------------- 1 file changed, 124 insertions(+), 97 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 67c27aed..31033722 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -49,10 +49,13 @@ jobs: - name: Run tests run: ./gradlew app:test - build-gplay-debug: - name: Build Google Play debug + build-apks: + name: Build apks needs: [ check-code-style, run-tests ] runs-on: ubuntu-latest + strategy: + matrix: + buildType: [ GplayDebug, GplayRelease ] steps: - name: Checkout uses: actions/checkout@v3 @@ -69,98 +72,122 @@ jobs: - name: Build run: | - ./gradlew app:assembleGplayDebug - - - name: Store APK file - uses: actions/upload-artifact@v3 - with: - name: app-gplay-debug.apk - path: | - ./app/build/outputs/apk/gplay/debug/app-gplay-debug.apk - - build-gplay-release: - name: Build Google Play release - needs: [ check-code-style, run-tests ] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' - - - name: Decrypt and validate decrypted data - env: - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run: ./.github/workflows/decrypt-and-validate-data.sh - - - name: Build - run: | - ./gradlew app:assembleGplayRelease - - - name: Store APK file - uses: actions/upload-artifact@v3 - with: - name: app-gplay-release.apk - path: | - ./app/build/outputs/apk/gplay/release/app-gplay-release.apk - - build-fdroid-debug: - name: Build FDroid debug - needs: [ check-code-style, run-tests ] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' - - - name: Decrypt and validate decrypted data - env: - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run: ./.github/workflows/decrypt-and-validate-data.sh - - - name: Build - run: | - ./gradlew app:assembleFdroidDebug - - - name: Store APK file - uses: actions/upload-artifact@v3 - with: - name: app-fdroid-debug.apk - path: | - ./app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk - - build-fdroid-release: - name: Build FDroid release - needs: [ check-code-style, run-tests ] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' - - - name: Decrypt and validate decrypted data - env: - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run: ./.github/workflows/decrypt-and-validate-data.sh - - - name: Build - run: | - ./gradlew app:assembleFdroidRelease - - - name: Store APK file - uses: actions/upload-artifact@v3 - with: - name: app-fdroid-release.apk - path: | - ./app/build/outputs/apk/fdroid/release/app-fdroid-release.apk \ No newline at end of file + ./gradlew app:assemble${{ matrix.buildType }} + + +# +# build-gplay-debug: +# name: Build Google Play debug +# needs: [ check-code-style, run-tests ] +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - uses: actions/setup-java@v3 +# with: +# distribution: 'zulu' +# java-version: '17' +# +# - name: Decrypt and validate decrypted data +# env: +# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} +# run: ./.github/workflows/decrypt-and-validate-data.sh +# +# - name: Build +# run: | +# ./gradlew app:assembleGplayDebug +# +# - name: Store APK file +# uses: actions/upload-artifact@v3 +# with: +# name: app-gplay-debug.apk +# path: | +# ./app/build/outputs/apk/gplay/debug/app-gplay-debug.apk +# +# build-gplay-release: +# name: Build Google Play release +# needs: [ check-code-style, run-tests ] +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - uses: actions/setup-java@v3 +# with: +# distribution: 'zulu' +# java-version: '17' +# +# - name: Decrypt and validate decrypted data +# env: +# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} +# run: ./.github/workflows/decrypt-and-validate-data.sh +# +# - name: Build +# run: | +# ./gradlew app:assembleGplayRelease +# +# - name: Store APK file +# uses: actions/upload-artifact@v3 +# with: +# name: app-gplay-release.apk +# path: | +# ./app/build/outputs/apk/gplay/release/app-gplay-release.apk +# +# build-fdroid-debug: +# name: Build FDroid debug +# needs: [ check-code-style, run-tests ] +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - uses: actions/setup-java@v3 +# with: +# distribution: 'zulu' +# java-version: '17' +# +# - name: Decrypt and validate decrypted data +# env: +# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} +# run: ./.github/workflows/decrypt-and-validate-data.sh +# +# - name: Build +# run: | +# ./gradlew app:assembleFdroidDebug +# +# - name: Store APK file +# uses: actions/upload-artifact@v3 +# with: +# name: app-fdroid-debug.apk +# path: | +# ./app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk +# +# build-fdroid-release: +# name: Build FDroid release +# needs: [ check-code-style, run-tests ] +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - uses: actions/setup-java@v3 +# with: +# distribution: 'zulu' +# java-version: '17' +# +# - name: Decrypt and validate decrypted data +# env: +# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} +# run: ./.github/workflows/decrypt-and-validate-data.sh +# +# - name: Build +# run: | +# ./gradlew app:assembleFdroidRelease +# +# - name: Store APK file +# uses: actions/upload-artifact@v3 +# with: +# name: app-fdroid-release.apk +# path: | +# ./app/build/outputs/apk/fdroid/release/app-fdroid-release.apk \ No newline at end of file