From 9b7da05ecf80a61d3abd727e99007fdf1df6b929 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Mon, 3 Jan 2022 11:58:50 +0100 Subject: [PATCH 1/7] Fix #3: Test, Build, Sign and push to GH releases --- .github/workflows/android.yml | 75 +++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 00000000..457a4782 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,75 @@ +name: Build & Publish Release APK + +on: + push: + branches: + - '*' + tags: + - '*' + +jobs: + build: + name: Build/Test APK + runs-on: ubuntu-latest + steps: + + - name: checkout code + uses: actions/checkout@v2 + + - name: setup jdk + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: 11 + + - name: Run Tests + run: cd obv_messenger/ && ./gradlew test --stacktrace + + - name: Build Release APK + run: cd obv_messenger/ && ./gradlew assembleRelease --stacktrace + + - name: Rename APK + run: mv obv_messenger/app/build/outputs/apk/prod/release/app-prod-release-unsigned.apk Olvid.apk + + - name: Upload APK + uses: actions/upload-artifact@v2 + with: + name: apk + path: Olvid.apk + + release: + name: Sign/Release APK + needs: build + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + + - name: Download APK from build + uses: actions/download-artifact@v2 + with: + name: apk + + - name: setup jdk + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: 11 + + - name: Sign APK + uses: r0adkll/sign-android-release@v1 + id: sign_app + with: + releaseDirectory: . + signingKeyBase64: ${{ secrets.SIGNING_KEY }} + alias: ${{ secrets.ALIAS }} + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + env: + BUILD_TOOLS_VERSION: "32.0.0" + + - name: Upload Release APK + uses: softprops/action-gh-release@v1 + with: + files: | + Olvid.apk + ${{steps.sign_app.outputs.signedReleaseFile}} From be7d9305d001c3633ec1c188483dcb8ff7b221e4 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Fri, 28 Oct 2022 23:24:51 +0200 Subject: [PATCH 2/7] fix: "workaround" testing release v0.13.0_184 build --- .github/workflows/android.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 457a4782..3fd8d1ce 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -22,8 +22,8 @@ jobs: distribution: 'zulu' java-version: 11 - - name: Run Tests - run: cd obv_messenger/ && ./gradlew test --stacktrace + # - name: Run Tests + # run: cd obv_messenger/ && ./gradlew test --stacktrace - name: Build Release APK run: cd obv_messenger/ && ./gradlew assembleRelease --stacktrace From fea5fc5abd889eb8852abb151d2a15fa728f5547 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Thu, 26 Jan 2023 11:23:31 +0100 Subject: [PATCH 3/7] Adjust workflow for new build releases --- .github/workflows/android.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 3fd8d1ce..7d1e0597 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -29,13 +29,16 @@ jobs: run: cd obv_messenger/ && ./gradlew assembleRelease --stacktrace - name: Rename APK - run: mv obv_messenger/app/build/outputs/apk/prod/release/app-prod-release-unsigned.apk Olvid.apk + run: | + find . -name '*.apk' + mv ./obv_messenger/app/build/outputs/apk/prodFull/release/app-prod-full-release-unsigned.apk Olvid.apk + mv ./obv_messenger/app/build/outputs/apk/prodNogoogle/release/app-prod-nogoogle-release-unsigned.apk Olvid-nogoogle.apk - name: Upload APK - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: apk - path: Olvid.apk + path: Olvid*.apk release: name: Sign/Release APK @@ -45,7 +48,7 @@ jobs: steps: - name: Download APK from build - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: apk @@ -72,4 +75,6 @@ jobs: with: files: | Olvid.apk - ${{steps.sign_app.outputs.signedReleaseFile}} + Olvid-nogoogle.apk + ${{steps.sign_app.outputs.signedReleaseFile0}} + ${{steps.sign_app.outputs.signedReleaseFile1}} From b8465c852485b341d634c9c9e7f033d9ec134e51 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Thu, 26 Jan 2023 20:27:35 +0100 Subject: [PATCH 4/7] fix apk upload to release --- .github/workflows/android.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 7d1e0597..3070c066 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -76,5 +76,5 @@ jobs: files: | Olvid.apk Olvid-nogoogle.apk - ${{steps.sign_app.outputs.signedReleaseFile0}} - ${{steps.sign_app.outputs.signedReleaseFile1}} + Olvid-signed.apk + Olvid-nogoogle-signed.apk From 908d51c56658afd828d6289f21f631308fde9f36 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Thu, 20 Apr 2023 09:59:22 +0200 Subject: [PATCH 5/7] ci: Use java 17 --- .github/workflows/android.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 3070c066..536296ee 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-java@v2 with: distribution: 'zulu' - java-version: 11 + java-version: 17 # - name: Run Tests # run: cd obv_messenger/ && ./gradlew test --stacktrace @@ -56,7 +56,7 @@ jobs: uses: actions/setup-java@v2 with: distribution: 'zulu' - java-version: 11 + java-version: 17 - name: Sign APK uses: r0adkll/sign-android-release@v1 From 9db048339ab2c9e16f3a0f35d8b198a00cfd0552 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Thu, 2 May 2024 11:03:33 +0200 Subject: [PATCH 6/7] ci: Add workflow to automate the rebase and tag --- .github/workflows/android.yml | 22 ++++++++++- .github/workflows/rebase.yml | 70 +++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/rebase.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 536296ee..61419108 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -6,6 +6,11 @@ on: - '*' tags: - '*' + workflow_dispatch: + inputs: + ref: + type: string + description: "The tag to use" jobs: build: @@ -14,7 +19,9 @@ jobs: steps: - name: checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref || github.ref }} - name: setup jdk uses: actions/setup-java@v2 @@ -43,10 +50,16 @@ jobs: release: name: Sign/Release APK needs: build - if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(inputs.ref || github.ref, 'refs/tags/v') runs-on: ubuntu-latest steps: + - name: checkout code + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref || github.ref }} + fetch-depth: 0 + - name: Download APK from build uses: actions/download-artifact@v3 with: @@ -70,9 +83,14 @@ jobs: env: BUILD_TOOLS_VERSION: "32.0.0" + - name: 'Get Previous tag' + id: previoustag + uses: "WyriHaximus/github-action-get-previous-tag@v1" + - name: Upload Release APK uses: softprops/action-gh-release@v1 with: + tag_name: ${{ steps.previoustag.outputs.tag }} files: | Olvid.apk Olvid-nogoogle.apk diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml new file mode 100644 index 00000000..a802f464 --- /dev/null +++ b/.github/workflows/rebase.yml @@ -0,0 +1,70 @@ +name: Rebase and tag + +on: + workflow_dispatch: + # inputs: + # sync_test_mode: # Adds a boolean option that appears during manual workflow run for easy test mode config + # description: 'Test Mode' + # type: boolean + # default: false + +jobs: + sync_latest_from_upstream: + name: Sync latest commits from upstream repo and tag + runs-on: ubuntu-latest + permissions: + contents: write + steps: + + - name: checkout code + uses: actions/checkout@v4 + with: + ref: build-apk + fetch-depth: 0 + + - name: Sync upstream changes + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4.1 + with: + target_sync_branch: build-apk + # REQUIRED 'target_repo_token' exactly like this! + target_repo_token: ${{ secrets.GITHUB_TOKEN }} + target_branch_push_args: '--force' + upstream_sync_branch: main + upstream_sync_repo: olvid-io/olvid-android + upstream_pull_args: '--rebase --tags' + + # Set test_mode true during manual dispatch to run tests instead of the true action!! + test_mode: ${{ inputs.sync_test_mode }} + + - name: New commits found + if: steps.sync.outputs.has_new_commits == 'true' + run: echo "New commits were found to sync." + + - name: No new commits + if: steps.sync.outputs.has_new_commits == 'false' + run: echo "There were no new commits." + + - name: Show value of 'has_new_commits' + run: echo ${{ steps.sync.outputs.has_new_commits }} + + - name: 'Get Previous tag' + if: steps.sync.outputs.has_new_commits == 'true' + id: previoustag + uses: "WyriHaximus/github-action-get-previous-tag@v1" + + - name: Bump version and push tag + if: steps.sync.outputs.has_new_commits == 'true' + uses: EndBug/latest-tag@latest + with: + github_token: ${{ secrets.GH_TOKEN }} + ref: "${{ steps.previoustag.outputs.tag }}-kumy1" + + - name: Trigger build + if: steps.sync.outputs.has_new_commits == 'true' + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: | + gh workflow run android.yml \ + -R kumy/olvid-android \ + -F "ref=refs/tags/${{ steps.previoustag.outputs.tag }}-kumy1" From 6f1651819a1f45487d1438baae2d593410dc0300 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Wed, 25 Sep 2024 19:31:09 +0200 Subject: [PATCH 7/7] ci: Raise Gradle memory --- obv_messenger/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obv_messenger/gradle.properties b/obv_messenger/gradle.properties index 73261e9e..c6cdd8ac 100644 --- a/obv_messenger/gradle.properties +++ b/obv_messenger/gradle.properties @@ -19,4 +19,4 @@ android.enableJetifier=false android.nonFinalResIds=true android.nonTransitiveRClass=true android.useAndroidX=true -org.gradle.jvmargs=-Xmx1536M -Dkotlin.daemon.jvm.options\="-Xmx1536M" +org.gradle.jvmargs=-Xmx4096M -Dkotlin.daemon.jvm.options\="-Xmx4096M" \ No newline at end of file