From 59d65060e5de5e691f89031b2d9954a6f64c3823 Mon Sep 17 00:00:00 2001 From: Inhishonor Date: Tue, 9 Dec 2025 17:41:37 -0800 Subject: [PATCH] Support building a fdroid variant --- .github/workflows/build-and-release.yml | 23 +++++++++++++++++++---- presentation/build.gradle | 9 +++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 0cce075f..de593ca4 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -130,10 +130,10 @@ jobs: uses: gradle/wrapper-validation-action@v1 - name: Build signed release APK - run: ./gradlew clean assembleRelease + run: ./gradlew clean assembleRelease assembleFdroid - name: Locate release artifact - id: artifact + id: release_artifact shell: bash run: | set -euo pipefail @@ -143,7 +143,20 @@ jobs: echo "::error title=APK lookup failed::Expected 1 APK, found ${#files[@]} (${files[*]:-none})." exit 1 fi - echo "apk_path=${files[0]}" >> "$GITHUB_OUTPUT" + echo "apk_release_path=${files[0]}" >> "$GITHUB_OUTPUT" + + - name: Locate f-droid artifact + id: fdroid_artifact + shell: bash + run: | + set -euo pipefail + shopt -s nullglob + files=(presentation/build/outputs/apk/fdroid/QUIK-v*-fdroid.apk) + if [[ "${#files[@]}" -ne 1 ]]; then + echo "::error title=APK lookup failed::Expected 1 APK, found ${#files[@]} (${files[*]:-none})." + exit 1 + fi + echo "apk_fdroid_path=${files[0]}" >> "$GITHUB_OUTPUT" - name: Generate release notes id: notes @@ -208,7 +221,9 @@ jobs: draft: ${{ inputs.publish_release != true }} prerelease: ${{ inputs.prerelease }} body: ${{ steps.clean_notes.outputs.clean_notes }} - files: ${{ steps.artifact.outputs.apk_path }} + files: | + ${{ steps.release_artifact.outputs.apk_release_path }} + ${{ steps.fdroid_artifact.outputs.apk_fdroid_path }} fail_on_unmatched_files: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/presentation/build.gradle b/presentation/build.gradle index e321e0e8..dfdcc8aa 100644 --- a/presentation/build.gradle +++ b/presentation/build.gradle @@ -72,6 +72,14 @@ android { resValue("string", "app_name", "QUIK-Debug") signingConfig signingConfigs.debug } + fdroid { + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + signingConfig signingConfigs.release + matchingFallbacks = ['release'] + applicationIdSuffix ".fdroid" + } } compileOptions { @@ -105,6 +113,7 @@ androidExtensions { configurations { debug release + fdroid } dependencies {