Fix Android SDK provisioning for API 37 in CI

This commit is contained in:
bponders12-cell 2026-09-01 18:18:48 -04:00
parent d01dd7ac0c
commit b763a1b0f8
1 changed files with 17 additions and 11 deletions

View File

@ -49,11 +49,13 @@ jobs:
shell: bash
run: |
set -euo pipefail
SDKMANAGER="$(find "${ANDROID_SDK_ROOT:-$ANDROID_HOME}/cmdline-tools" -type f -name sdkmanager 2>/dev/null | head -n 1)"
test -n "$SDKMANAGER" || { echo "Android sdkmanager not found"; exit 1; }
SDKROOT="${ANDROID_SDK_ROOT:-$ANDROID_HOME}"
SDKROOT="${ANDROID_SDK_ROOT:-${ANDROID_HOME:-}}"
test -n "$SDKROOT" || { echo "Android SDK root is not configured"; exit 1; }
SDKMANAGER="$(find "$SDKROOT/cmdline-tools" -type f -name sdkmanager -print -quit 2>/dev/null || true)"
test -x "$SDKMANAGER" || { echo "Android sdkmanager not found under $SDKROOT/cmdline-tools"; exit 1; }
"$SDKMANAGER" --licenses </dev/null >/dev/null 2>&1 || true
"$SDKMANAGER" "platform-tools" "platforms;android-${ANDROID_COMPILE_SDK}" "build-tools;37.0.0"
yes | "$SDKMANAGER" --licenses >/dev/null 2>&1 || true
"$SDKMANAGER" "platforms;android-${ANDROID_COMPILE_SDK}"
echo "ANDROID_SDK_ROOT=$SDKROOT" >> "$GITHUB_ENV"
- name: Provision Gradle wrapper
@ -72,6 +74,7 @@ jobs:
flutter --version
flutter doctor -v
java -version
sdkmanager --list_installed | grep -E 'platforms;android-37|build-tools;37|platform-tools' || true
- name: Get dependencies
run: flutter pub get
@ -134,10 +137,14 @@ jobs:
shell: bash
run: |
set -euo pipefail
SDKMANAGER="$(find "${ANDROID_SDK_ROOT:-$ANDROID_HOME}/cmdline-tools" -type f -name sdkmanager 2>/dev/null | head -n 1)"
test -n "$SDKMANAGER" || { echo "Android sdkmanager not found"; exit 1; }
SDKROOT="${ANDROID_SDK_ROOT:-${ANDROID_HOME:-}}"
test -n "$SDKROOT" || { echo "Android SDK root is not configured"; exit 1; }
SDKMANAGER="$(find "$SDKROOT/cmdline-tools" -type f -name sdkmanager -print -quit 2>/dev/null || true)"
test -x "$SDKMANAGER" || { echo "Android sdkmanager not found under $SDKROOT/cmdline-tools"; exit 1; }
"$SDKMANAGER" --licenses </dev/null >/dev/null 2>&1 || true
"$SDKMANAGER" "platform-tools" "platforms;android-${ANDROID_COMPILE_SDK}" "build-tools;37.0.0"
yes | "$SDKMANAGER" --licenses >/dev/null 2>&1 || true
"$SDKMANAGER" "platforms;android-${ANDROID_COMPILE_SDK}"
echo "ANDROID_SDK_ROOT=$SDKROOT" >> "$GITHUB_ENV"
- name: Provision Gradle wrapper
shell: bash
@ -191,7 +198,6 @@ jobs:
run: |
set -euo pipefail
keytool -list -keystore android/app/motorsignal-upload-keystore.jks \
-storetype PKCS12 \
-storepass "$STORE_PASSWORD" \
-alias "$KEY_ALIAS" >/dev/null
@ -202,8 +208,6 @@ jobs:
run: flutter build appbundle --release
- name: Verify release artifacts and signatures
env:
STORE_PASSWORD: ${{ secrets.MOTORSIGNAL_STORE_PASSWORD }}
shell: bash
run: |
set -euo pipefail
@ -212,7 +216,9 @@ jobs:
test -s "$APK"
test -s "$AAB"
file "$APK" "$AAB"
"$ANDROID_HOME/build-tools/$(ls "$ANDROID_HOME/build-tools" | sort -V | tail -n 1)/apksigner" verify --verbose "$APK"
APKSIGNER="$(find "$ANDROID_HOME/build-tools" -type f -name apksigner -print | sort -V | tail -n 1)"
test -x "$APKSIGNER" || { echo "apksigner not found"; exit 1; }
"$APKSIGNER" verify --verbose "$APK"
sha256sum "$APK" "$AAB" | tee build/release-artifacts.sha256
- name: Upload release APK