mirror of
https://github.com/actions/runner-images.git
synced 2025-12-18 07:46:57 +00:00
[Ubuntu] Install latest Android cmdline-tools (#5639)
* [Ubuntu] Install latest Android cmdline-tools * Move yq installation
This commit is contained in:
committed by
GitHub
parent
1938bdf841
commit
82d552ac56
@@ -50,8 +50,24 @@ mkdir -p ${ANDROID_SDK_ROOT}
|
||||
|
||||
# Download the latest command line tools so that we can accept all of the licenses.
|
||||
# See https://developer.android.com/studio/#command-tools
|
||||
cmdlineToolsVersion=$(get_toolset_value '.android."cmdline-tools"')
|
||||
if [[ $cmdlineToolsVersion == "latest" ]]; then
|
||||
repositoryXmlUrl="https://dl.google.com/android/repository/repository2-1.xml"
|
||||
download_with_retries $repositoryXmlUrl "/tmp" "repository2-1.xml"
|
||||
cmdlineToolsVersion=$(
|
||||
yq -p=xml \
|
||||
'.sdk-repository.remotePackage[] | select(."+path" == "cmdline-tools;latest").archives.archive[].complete.url | select(contains("commandlinetools-linux"))' \
|
||||
/tmp/repository2-1.xml
|
||||
)
|
||||
|
||||
if [[ -z $cmdlineToolsVersion ]]; then
|
||||
echo "Failed to parse latest command-line tools version"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
cmdlineTools="android-cmdline-tools.zip"
|
||||
download_with_retries https://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip "." $cmdlineTools
|
||||
download_with_retries "https://dl.google.com/android/repository/${cmdlineToolsVersion}" "." $cmdlineTools
|
||||
unzip -qq $cmdlineTools -d ${ANDROID_SDK_ROOT}/cmdline-tools
|
||||
# Command line tools need to be placed in ${ANDROID_SDK_ROOT}/sdk/cmdline-tools/latest to determine SDK root
|
||||
mv ${ANDROID_SDK_ROOT}/cmdline-tools/cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/latest
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
"maven": "3.8.5"
|
||||
},
|
||||
"android": {
|
||||
"cmdline-tools": "latest",
|
||||
"platform_min_version": "23",
|
||||
"build_tools_min_version": "23.0.1",
|
||||
"extra_list": [
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
"maven": "3.8.5"
|
||||
},
|
||||
"android": {
|
||||
"cmdline-tools": "latest",
|
||||
"platform_min_version": "27",
|
||||
"build_tools_min_version": "27.0.0",
|
||||
"extra_list": [
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
"maven": "3.8.5"
|
||||
},
|
||||
"android": {
|
||||
"cmdline-tools": "latest",
|
||||
"platform_min_version": "27",
|
||||
"build_tools_min_version": "27.0.0",
|
||||
"extra_list": [
|
||||
|
||||
@@ -242,8 +242,8 @@
|
||||
"{{template_dir}}/scripts/installers/vcpkg.sh",
|
||||
"{{template_dir}}/scripts/installers/dpkg-config.sh",
|
||||
"{{template_dir}}/scripts/installers/mongodb.sh",
|
||||
"{{template_dir}}/scripts/installers/android.sh",
|
||||
"{{template_dir}}/scripts/installers/yq.sh",
|
||||
"{{template_dir}}/scripts/installers/android.sh",
|
||||
"{{template_dir}}/scripts/installers/pypy.sh",
|
||||
"{{template_dir}}/scripts/installers/python.sh",
|
||||
"{{template_dir}}/scripts/installers/aws.sh"
|
||||
|
||||
@@ -243,8 +243,8 @@
|
||||
"{{template_dir}}/scripts/installers/vcpkg.sh",
|
||||
"{{template_dir}}/scripts/installers/dpkg-config.sh",
|
||||
"{{template_dir}}/scripts/installers/mongodb.sh",
|
||||
"{{template_dir}}/scripts/installers/android.sh",
|
||||
"{{template_dir}}/scripts/installers/yq.sh",
|
||||
"{{template_dir}}/scripts/installers/android.sh",
|
||||
"{{template_dir}}/scripts/installers/pypy.sh",
|
||||
"{{template_dir}}/scripts/installers/python.sh",
|
||||
"{{template_dir}}/scripts/installers/graalvm.sh"
|
||||
|
||||
@@ -313,8 +313,8 @@ build {
|
||||
"${path.root}/scripts/installers/packer.sh",
|
||||
"${path.root}/scripts/installers/vcpkg.sh",
|
||||
"${path.root}/scripts/installers/dpkg-config.sh",
|
||||
"${path.root}/scripts/installers/android.sh",
|
||||
"${path.root}/scripts/installers/yq.sh",
|
||||
"${path.root}/scripts/installers/android.sh",
|
||||
"${path.root}/scripts/installers/pypy.sh",
|
||||
"${path.root}/scripts/installers/python.sh",
|
||||
"${path.root}/scripts/installers/graalvm.sh"
|
||||
|
||||
Reference in New Issue
Block a user