From e65a3edab58ceaf9d8ebb86073d52154dc9440fd Mon Sep 17 00:00:00 2001 From: MohamadJaara Date: Mon, 29 Jul 2024 08:50:56 +0200 Subject: [PATCH 1/4] ci: build fdroid for regression testing --- .github/workflows/build-fdroid-app.yml | 78 ++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/build-fdroid-app.yml diff --git a/.github/workflows/build-fdroid-app.yml b/.github/workflows/build-fdroid-app.yml new file mode 100644 index 00000000000..f444a1be989 --- /dev/null +++ b/.github/workflows/build-fdroid-app.yml @@ -0,0 +1,78 @@ +name: "Prod build" + +on: + push: + branches: + - main +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.merge_group.head_sha }} + cancel-in-progress: true + +jobs: + code-analysis: + uses: ./.github/workflows/code-analysis.yml + ui-tests: + uses: ./.github/workflows/gradle-run-ui-tests.yml + unit-tests: + uses: ./.github/workflows/gradle-run-unit-tests.yml + build-app: + needs: [ code-analysis, ui-tests, unit-tests ] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive # Needed in order to fetch Kalium sources for building + fetch-depth: 0 + - name: Set up JDK 17 + uses: buildjet/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + - name: Decode Keystore + env: + ENCODED_STRING: ${{ secrets.ENCODED_KEYSTORE_PUBLIC_RELEASE }} + run: | + TMP_KEYSTORE_FILE_PATH="${RUNNER_TEMP}"/keystore + mkdir "${TMP_KEYSTORE_FILE_PATH}" + echo $ENCODED_STRING | base64 -di > "${TMP_KEYSTORE_FILE_PATH}"/the.keystore + - name: Make gradlew executable + run: chmod +x ./gradlew + - name: build prod flavour APK + run: + ./gradlew app:assembleFdroidCompatRelease + env: + KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }} + KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }} + KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }} + KEYSTORE_FILE_PATH_COMPAT_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }} + KEYSTORE_KEY_NAME_COMPAT_RELEASE: ${{ secrets.SIGNING_KEY_ALIAS_PUBLIC_RELEASE }} + KEYPWD_COMPAT_RELEASE: ${{ secrets.SIGNING_KEY_PASSWORD_PUBLIC_RELEASE }} + KEYSTOREPWD_COMPAT_RELEASE: ${{ secrets.SIGNING_STORE_PASSWORD_PUBLIC_RELEASE }} + ENABLE_SIGNING: ${{ secrets.ENABLE_SIGNING }} + - name: build prod flavour bundle + run: + ./gradlew app:bundleProdCompatRelease + env: + KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }} + KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }} + KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }} + KEYSTORE_FILE_PATH_COMPAT_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }} + KEYSTORE_KEY_NAME_COMPAT_RELEASE: ${{ secrets.SIGNING_KEY_ALIAS_PUBLIC_RELEASE }} + KEYPWD_COMPAT_RELEASE: ${{ secrets.SIGNING_KEY_PASSWORD_PUBLIC_RELEASE }} + KEYSTOREPWD_COMPAT_RELEASE: ${{ secrets.SIGNING_STORE_PASSWORD_PUBLIC_RELEASE }} + ENABLE_SIGNING: ${{ secrets.ENABLE_SIGNING }} + - name: Deploy ProdCompatRelease to S3 + uses: ./.github/actions/deploy-to-s3 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-bucket: ${{ secrets.AWS_S3_BUCKET }} + github-token: ${{ secrets.GITHUB_TOKEN }} + build-flavour: Fdroid + build-variant: compatrelease + - name: Attach APK to release + uses: softprops/action-gh-release@v2.0.7 + with: + files: app/build/outputs/apk/fdroidCompatRelease/*.apk From 1c78d1bf9c2228330a7db4a8ce6385ff7d4cc3b1 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Mon, 29 Jul 2024 13:44:53 +0200 Subject: [PATCH 2/4] Update .github/workflows/build-fdroid-app.yml Co-authored-by: Yamil Medina --- .github/workflows/build-fdroid-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-fdroid-app.yml b/.github/workflows/build-fdroid-app.yml index f444a1be989..6013a693fb5 100644 --- a/.github/workflows/build-fdroid-app.yml +++ b/.github/workflows/build-fdroid-app.yml @@ -5,7 +5,7 @@ on: branches: - main concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.merge_group.head_sha }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: From f95a74887a9981a38744531e2ff0dab4b054b6a3 Mon Sep 17 00:00:00 2001 From: MohamadJaara Date: Mon, 29 Jul 2024 16:34:40 +0200 Subject: [PATCH 3/4] address pr comments --- .github/workflows/build-fdroid-app.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/build-fdroid-app.yml b/.github/workflows/build-fdroid-app.yml index 6013a693fb5..2df20d4c98f 100644 --- a/.github/workflows/build-fdroid-app.yml +++ b/.github/workflows/build-fdroid-app.yml @@ -51,19 +51,7 @@ jobs: KEYPWD_COMPAT_RELEASE: ${{ secrets.SIGNING_KEY_PASSWORD_PUBLIC_RELEASE }} KEYSTOREPWD_COMPAT_RELEASE: ${{ secrets.SIGNING_STORE_PASSWORD_PUBLIC_RELEASE }} ENABLE_SIGNING: ${{ secrets.ENABLE_SIGNING }} - - name: build prod flavour bundle - run: - ./gradlew app:bundleProdCompatRelease - env: - KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }} - KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }} - KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }} - KEYSTORE_FILE_PATH_COMPAT_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }} - KEYSTORE_KEY_NAME_COMPAT_RELEASE: ${{ secrets.SIGNING_KEY_ALIAS_PUBLIC_RELEASE }} - KEYPWD_COMPAT_RELEASE: ${{ secrets.SIGNING_KEY_PASSWORD_PUBLIC_RELEASE }} - KEYSTOREPWD_COMPAT_RELEASE: ${{ secrets.SIGNING_STORE_PASSWORD_PUBLIC_RELEASE }} - ENABLE_SIGNING: ${{ secrets.ENABLE_SIGNING }} - - name: Deploy ProdCompatRelease to S3 + - name: Deploy FdroidCompatRelease to S3 uses: ./.github/actions/deploy-to-s3 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} From 1501e155ceb3c90f0172ca70d9e44f12cb9d7594 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Mon, 29 Jul 2024 16:47:43 +0200 Subject: [PATCH 4/4] Update .github/workflows/build-fdroid-app.yml Co-authored-by: Yamil Medina --- .github/workflows/build-fdroid-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-fdroid-app.yml b/.github/workflows/build-fdroid-app.yml index 2df20d4c98f..04c23a7adfe 100644 --- a/.github/workflows/build-fdroid-app.yml +++ b/.github/workflows/build-fdroid-app.yml @@ -1,4 +1,4 @@ -name: "Prod build" +name: "Fdroid build" on: push: