Files
werk/scripts/release-android.sh
T
waozi ea2fe95a36
Cloudflare Pages / Package URLs are public HTTPS (push) Canceled after 0s
Cloudflare Pages / build (push) Canceled after 0s
Cloudflare Pages / Deploy Site (push) Canceled after 0s
Give Kryon codec resolution the bootstrap ziran
2026-11-29 12:01:29 -03:00

39 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build signed distribution editions from the locked graph.
set -euo pipefail
cd "$(dirname "$0")/.."
test ! -e ziran.local.toml || { echo 'Release builds require ziran.lock without local overrides' >&2; exit 1; }
: "${KEYSTORE_PASSWORD:?Missing release keystore password}"
: "${KEY_ALIAS:?Missing release key alias}"
keystore=${WERK_RELEASE_KEYSTORE:-$HOME/.android/pass-release.keystore}
test -s "$keystore"
version=$(cat VERSION)
ziran="$PWD/scripts/ziran.sh"
export WERK_ZIRAN_COMMAND=$ziran
# Kryon's CMake resolves codec packages through ZIRAN_BIN.
export ZIRAN_BIN=$ziran
KRYON_DIR=$($ziran pkg path kryon --locked)
ZIRAN_ROOT=$($ziran pkg path ziran --locked)
LIBOQS_DIR=$($ziran pkg path liboqs --locked)
MONOCYPHER_DIR=$($ziran pkg path monocypher --locked)
export KRYON_DIR ZIRAN_ROOT LIBOQS_DIR MONOCYPHER_DIR
mkdir -p build/release
for edition in normal fdroid gplay; do
suffix=
if [[ $edition != normal ]]; then suffix="-$edition"; fi
./droid/gradlew -p droid assembleRelease --no-daemon --max-workers=1 \
-PsplitApks=true -Papp.edition="$edition" \
-Pkeystore.path="$keystore" -Pkeystore.alias="$KEY_ALIAS" \
-Pkeystore.password="$KEYSTORE_PASSWORD" --stacktrace
for abi in universal arm64-v8a armeabi-v7a; do
abi_suffix=
if [[ $abi != universal ]]; then abi_suffix="-$abi"; fi
apk="droid/app/build/outputs/apk/release/app-$abi-release.apk"
test -s "$apk"
apksigner verify "$apk"
cp "$apk" "build/release/werk-android$abi_suffix$suffix.apk"
cp "$apk" "build/release/werk-$version$abi_suffix$suffix.apk"
done
done
python3 scripts/android_apk_check.py build/release/werk-android*.apk