ci(release): build tesseract4android from source for F-Droid reproducibility; v0.1.4 (+6)
Some checks failed
ci / test-commons-core (push) Successful in 1m27s
ci / analyze (push) Successful in 2m17s
release / android (push) Failing after 4m50s
ci / test-app-seeds (push) Successful in 10m40s

This commit is contained in:
vjrj 2026-07-19 06:18:04 +02:00
parent b76083be57
commit a575f01207
2 changed files with 21 additions and 1 deletions

View file

@ -63,6 +63,26 @@ jobs:
keyPassword=$TANE_KEY_PASSWORD
EOF
- name: Build tesseract4android from source (match F-Droid for reproducibility)
working-directory: apps/app_seeds
run: |
set -eu
# F-Droid forbids the prebuilt AAR that ships in flutter_tesseract_ocr, so
# its recipe rebuilds tesseract4android@4.9.0 from source and swaps the AAR
# into the pub cache. We do the SAME here so our published reference APK is
# byte-for-byte reproducible against F-Droid's build (keeps AllowedAPKSigningKeys
# + binary: valid — see metadata/org.comunes.tane.yml in fdroiddata).
t4a="$GITHUB_WORKSPACE/tesseract4android-src"
git clone --depth 1 -b 4.9.0 https://github.com/adaptech-cz/Tesseract4Android.git "$t4a"
# Install the exact NDK the project pins, if the image lacks it.
ndkv=$(grep -RhoE 'ndkVersion[^0-9]*[0-9][0-9.]+' "$t4a" | grep -oE '[0-9]+\.[0-9.]+' | head -1 || true)
[ -n "${ndkv:-}" ] && (yes | sdkmanager "ndk;$ndkv" >/dev/null 2>&1 || true)
( cd "$t4a/tesseract4android" && ./gradlew --no-daemon assembleStandardRelease )
aar_dst=$(find ${PUB_CACHE:+$PUB_CACHE} "$HOME/.pub-cache" /root/.pub-cache /sdks 2>/dev/null \
-path '*flutter_tesseract_ocr-0.4.31/android/libs/tesseract4android-release.aar' | head -1)
cp "$t4a/tesseract4android/build/outputs/aar/tesseract4android-standard-release.aar" "$aar_dst"
echo "swapped source-built tesseract AAR -> $aar_dst"
- name: Build signed AAB + per-ABI APKs
working-directory: apps/app_seeds
run: |