feat: ship native boss android console
This commit is contained in:
29
scripts/build-release-apk.sh
Executable file
29
scripts/build-release-apk.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/zsh
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
ANDROID_DIR="$ROOT_DIR/android"
|
||||
RELEASE_APK="$ANDROID_DIR/app/build/outputs/apk/release/app-release.apk"
|
||||
BUILD_GRADLE="$ROOT_DIR/android/app/build.gradle"
|
||||
|
||||
VERSION_NAME="$(sed -n 's/.*versionName \"\([^\"]*\)\"/\1/p' "$BUILD_GRADLE" | head -n 1)"
|
||||
VERSIONED_RELEASE_APK="$ANDROID_DIR/app/build/outputs/apk/release/boss-android-v${VERSION_NAME}-release.apk"
|
||||
|
||||
zsh "$ROOT_DIR/scripts/prepare-android-signing.sh"
|
||||
|
||||
cd "$ANDROID_DIR"
|
||||
./gradlew assembleRelease
|
||||
|
||||
cd "$ROOT_DIR"
|
||||
cp "$RELEASE_APK" "$VERSIONED_RELEASE_APK"
|
||||
zsh "$ROOT_DIR/scripts/publish-apk-to-public.sh" "$RELEASE_APK"
|
||||
|
||||
APKSIGNER="$(find "${ANDROID_HOME:-$HOME/Library/Android/sdk}/build-tools" -name apksigner -type f 2>/dev/null | sort | tail -n 1)"
|
||||
if [[ -n "${APKSIGNER:-}" && -f "$APKSIGNER" ]]; then
|
||||
"$APKSIGNER" verify --print-certs "$RELEASE_APK"
|
||||
else
|
||||
echo "apksigner not found, skipped signature verification output" >&2
|
||||
fi
|
||||
|
||||
echo "Signed release APK ready: $RELEASE_APK"
|
||||
echo "Versioned release APK ready: $VERSIONED_RELEASE_APK"
|
||||
Reference in New Issue
Block a user