- App downloads updates itself, verifies SHA-256, opens the installer; manual Check for updates menu item - Server publishes the checksum and serves /download/IndexiPro-<v>.apk - android/release.sh tags v<version> and publishes IndexiPro-<version>.apk to the Gitea release, so F-Droid can track a versioned URL - Bump app to 1.2.0 (versionCode 3)
21 lines
995 B
Bash
Executable File
21 lines
995 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Builds the release APK and copies it into the web app, which then offers it for download and
|
|
# in-app updates. Also writes the versioned copy android/dist/IndexiPro-<version>.apk that
|
|
# release.sh attaches to the Gitea release. Bump versionCode/versionName in app/build.gradle.kts first.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
./gradlew --no-daemon -q assembleRelease
|
|
code=$(grep -oP 'versionCode = \K[0-9]+' app/build.gradle.kts)
|
|
name=$(grep -oP 'versionName = "\K[^"]+' app/build.gradle.kts)
|
|
apk=app/build/outputs/apk/release/app-release.apk
|
|
sha=$(sha256sum "$apk" | cut -d' ' -f1)
|
|
|
|
out=../server/public/download
|
|
mkdir -p "$out" dist
|
|
cp "$apk" "$out/indexipro.apk"
|
|
cp "$apk" "dist/IndexiPro-$name.apk"
|
|
printf '{ "versionCode": %s, "versionName": "%s", "sha256": "%s" }\n' "$code" "$name" "$sha" > "$out/indexipro.json"
|
|
echo "Built IndexiPro $name ($code) sha256=$sha"
|
|
echo " web app copy: $out/indexipro.apk"
|
|
echo " release asset: android/dist/IndexiPro-$name.apk"
|