- compileSdk/targetSdk 36: Google Play rejects new apps below API 36 since 31 August 2026. - Release signing from ANDROID_KEYSTORE_* environment variables or local.properties; unsigned when no upload key is configured. - versionCode/versionName overridable via VERSION_CODE/VERSION_NAME. - scripts/build-release-aab.sh builds and verifies a signed AAB. - CI installs platform 36 until the CI image is rebuilt. - Document the internal-testing upload flow.
This commit is contained in:
1 parent
43bd9629d3
commit
9b105b3925
6 files changed
+179
-10
No files matched your search
Executable
+55
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Build a signed Android App Bundle for the Google Play internal testing track.
|
||||
#
|
||||
# Usage:
|
||||
# scripts/build-release-aab.sh [versionCode] [versionName]
|
||||
#
|
||||
# Signing values are read by Gradle from the environment or local.properties:
|
||||
# UPLOAD_STORE_FILE absolute path to the upload keystore
|
||||
# UPLOAD_STORE_PASSWORD
|
||||
# UPLOAD_KEY_ALIAS
|
||||
# UPLOAD_KEY_PASSWORD
|
||||
#
|
||||
# Play requires a versionCode that is higher than every previous upload.
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$ROOT"
|
||||
|
||||
GRADLE="${GRADLE:-gradle}"
|
||||
AAB="composeApp/build/outputs/bundle/release/composeApp-release.aab"
|
||||
|
||||
prop() {
|
||||
local key="$1"
|
||||
[ -f local.properties ] || return 0
|
||||
grep -E "^${key}=" local.properties | tail -1 | cut -d= -f2-
|
||||
}
|
||||
|
||||
if [ -z "${ANDROID_KEYSTORE_PATH:-}" ] && [ -z "$(prop UPLOAD_STORE_FILE)" ]; then
|
||||
echo "No upload key configured: set UPLOAD_STORE_FILE in local.properties" >&2
|
||||
echo "or ANDROID_KEYSTORE_PATH in the environment." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION_CODE="${1:-${VERSION_CODE:-$(prop VERSION_CODE)}}"
|
||||
VERSION_NAME="${2:-${VERSION_NAME:-$(prop VERSION_NAME)}}"
|
||||
VERSION_CODE="${VERSION_CODE:-1}"
|
||||
VERSION_NAME="${VERSION_NAME:-0.1.0}"
|
||||
|
||||
export VERSION_CODE VERSION_NAME
|
||||
export ANDROID_HOME="${ANDROID_HOME:-${ANDROID_SDK_ROOT:-$HOME/Android/Sdk}}"
|
||||
|
||||
echo "Building AAB versionCode=$VERSION_CODE versionName=$VERSION_NAME"
|
||||
"$GRADLE" :composeApp:bundleRelease --console=plain
|
||||
|
||||
if ! jarsigner -verify "$AAB" >/dev/null 2>&1; then
|
||||
echo "AAB is not signed; check the upload keystore settings." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Signed bundle: $ROOT/$AAB"
|
||||
sha256sum "$AAB"
|
||||
echo
|
||||
echo "Upload it to Play Console > Testing > Internal testing > Create new release."
|
||||
Reference in new issue
Block a user