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 47ad9058..6f277acd 100644 --- a/presentation/build.gradle +++ b/presentation/build.gradle @@ -73,6 +73,14 @@ android { resValue("string", "application_id", defaultConfig.applicationId) signingConfig signingConfigs.debug } + fdroid { + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + signingConfig signingConfigs.release + matchingFallbacks = ['release'] + applicationIdSuffix ".fdroid" + } } compileOptions { @@ -106,6 +114,7 @@ androidExtensions { configurations { debug release + fdroid } dependencies {