From 06ac85febe56ac299d342950a2680df57e4ab830 Mon Sep 17 00:00:00 2001 From: Jason Ernst Date: Wed, 20 May 2026 12:28:13 -0700 Subject: [PATCH] Fix release: use platforms;android-37.0 and detect MAJOR.MINOR platforms The Deploy container workflow failed because the Dockerfile set COMPILE_SDK=37, but Google now publishes platforms under MAJOR.MINOR paths (platforms;android-37.0, android-36.1). There is no bare platforms;android-37, so sdkmanager failed with "Failed to find package 'platforms;android-37'". Root cause: check-sdk-updates.yml extracted the platform with `grep -oP 'android-\K\d+'`, truncating "37.0" to "37", then wrote that into the Dockerfile. The integer `-gt` comparison would also break on a MAJOR.MINOR value. - Dockerfile: COMPILE_SDK=37 -> 37.0 (installable; unblocks release) - check-sdk-updates: capture optional minor component and sort -V - check-sdk-updates: replace integer -gt with version-aware comparison Verified against Google's repository manifest: platforms;android-37.0, build-tools;37.0.0 and ndk;30.0.14904198 all exist. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/check-sdk-updates.yml | 10 ++++++++-- Dockerfile | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-sdk-updates.yml b/.github/workflows/check-sdk-updates.yml index 638d56e..078a7dd 100644 --- a/.github/workflows/check-sdk-updates.yml +++ b/.github/workflows/check-sdk-updates.yml @@ -74,7 +74,10 @@ jobs: fi # Get latest available versions - LATEST_PLATFORM=$(echo "$PACKAGES" | grep 'platforms;android-' | grep -oP 'android-\K\d+' | sort -n | tail -1) + # Platform packages now use MAJOR.MINOR versioning (e.g. android-36.1, + # android-37.0). Capture the optional minor component and sort by version + # so we don't truncate "37.0" to a non-existent "platforms;android-37". + LATEST_PLATFORM=$(echo "$PACKAGES" | grep 'platforms;android-' | grep -oP 'android-\K[0-9]+(\.[0-9]+)?' | sort -V | tail -1) LATEST_BUILD_TOOLS=$(echo "$PACKAGES" | grep 'build-tools;' | grep -oP 'build-tools;\K[0-9.]+' | sort -V | tail -1) LATEST_NDK=$(echo "$PACKAGES" | grep -P '^\s+ndk;' | grep -oP 'ndk;\K[0-9.]+' | sort -V | tail -1) @@ -92,7 +95,10 @@ jobs: # Check if updates are needed UPDATED=false - if [ -n "$LATEST_PLATFORM" ] && [ "$LATEST_PLATFORM" != "$CURRENT_PLATFORM" ] && [ "$LATEST_PLATFORM" -gt "$CURRENT_PLATFORM" ] 2>/dev/null; then + # Use version-aware comparison (not integer -gt) since platform versions + # can be MAJOR.MINOR. Update only when LATEST differs and sorts highest. + if [ -n "$LATEST_PLATFORM" ] && [ "$LATEST_PLATFORM" != "$CURRENT_PLATFORM" ] && \ + [ "$(printf '%s\n%s\n' "$CURRENT_PLATFORM" "$LATEST_PLATFORM" | sort -V | tail -1)" = "$LATEST_PLATFORM" ]; then UPDATED=true fi if [ -n "$LATEST_BUILD_TOOLS" ] && [ "$LATEST_BUILD_TOOLS" != "$CURRENT_BUILD_TOOLS" ]; then diff --git a/Dockerfile b/Dockerfile index ce00d9a..fd975a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ARG VERSION=2.334.0-ubuntu-noble ARG JAVA_VERSION=21 -ARG COMPILE_SDK=37 +ARG COMPILE_SDK=37.0 ARG BUILD_TOOLS=37.0.0 ARG NDK_VERSION=30.0.14904198 ARG SDK_TOOLS=8512546_latest