Repository navigation
ci: install the Android SDK through one setup-android-sdk action #4400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
thymikee
merged 2 commits into
main
from
claude/audit-findings-remediation-62d6ky-android-sdk-action
Nov 11, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: 'Setup Android SDK' | ||
| description: 'Install the pinned Android platform and build tools, and export the build-tools version' | ||
|
|
||
| # The one owner of the pinned build-tools version. d8 and aapt2 come from build-tools, so the | ||
| # version decides the helper APK bytes. Later steps read it from AGENT_DEVICE_ANDROID_BUILD_TOOLS. | ||
|
|
||
| inputs: | ||
| build-tools: | ||
| description: 'Android build-tools version to install' | ||
| required: false | ||
| default: '36.0.0' | ||
|
|
||
| outputs: | ||
| build-tools-dir: | ||
| description: 'Absolute path of the installed build-tools directory' | ||
| value: ${{ steps.install.outputs.build-tools-dir }} | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Install Android platform and build tools | ||
| id: install | ||
| shell: bash | ||
| env: | ||
| BUILD_TOOLS_VERSION: ${{ inputs.build-tools }} | ||
| run: | | ||
| set -euo pipefail | ||
| SDK_ROOT="${ANDROID_HOME:-${ANDROID_SDK_ROOT:-/usr/local/lib/android/sdk}}" | ||
| BUILD_TOOLS_DIR="$SDK_ROOT/build-tools/$BUILD_TOOLS_VERSION" | ||
| # Every build-tools binary a caller runs: the helper build (aapt2, d8, zipalign, | ||
| # apksigner) and the fixture APK scripts (aapt, apksigner). | ||
| INSTALLED=true | ||
| for BUILD_TOOL in aapt aapt2 d8 zipalign apksigner; do | ||
| [ -x "$BUILD_TOOLS_DIR/$BUILD_TOOL" ] || INSTALLED=false | ||
| done | ||
| [ -f "$SDK_ROOT/platforms/android-36/android.jar" ] || INSTALLED=false | ||
| if [ "$INSTALLED" != true ]; then | ||
| SDKMANAGER="$SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" | ||
| if [ ! -x "$SDKMANAGER" ]; then | ||
| SDKMANAGER="$SDK_ROOT/cmdline-tools/bin/sdkmanager" | ||
| fi | ||
| if [ ! -x "$SDKMANAGER" ]; then | ||
| echo "::error::sdkmanager not found under $SDK_ROOT." >&2 | ||
| exit 1 | ||
| fi | ||
| # `yes` dies of SIGPIPE when sdkmanager stops reading. Without pipefail the pipe | ||
| # reports sdkmanager's own status, so a real licence failure still stops the step. | ||
| set +o pipefail | ||
| yes | "$SDKMANAGER" --licenses >/dev/null | ||
| set -o pipefail | ||
| "$SDKMANAGER" "platforms;android-36" "build-tools;$BUILD_TOOLS_VERSION" | ||
| fi | ||
| echo "AGENT_DEVICE_ANDROID_BUILD_TOOLS=$BUILD_TOOLS_VERSION" >> "$GITHUB_ENV" | ||
| echo "build-tools-dir=$BUILD_TOOLS_DIR" >> "$GITHUB_OUTPUT" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.