mirror of
https://github.com/actions/runner-images.git
synced 2026-01-06 10:09:20 +08:00
[macos] simplify "brew_smart_install" helper (#8639)
* [macos] homebrew: use hardcoded condition for jq installation we cannot use "jq" if we are asked to install "jq" * [macos] always use "brew install" * [macos] add retries to "get_github_package_download_url" helper * [macos] add retries to chrome install script * [macos] add retries to OpenJDK install script * [macos] add retries to miniconda installer * Update images/macos/provision/core/openjdk.sh Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> * fix copy-paste error * Update images/macos/provision/core/openjdk.sh Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> * Update images/macos/provision/core/openjdk.sh Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> --------- Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com>
This commit is contained in:
@@ -29,12 +29,12 @@ installOpenJDK() {
|
||||
local JAVA_VERSION=$1
|
||||
|
||||
# Get link for Java binaries and Java version
|
||||
assetUrl=$(curl -fsSL "https://api.adoptium.net/v3/assets/latest/${JAVA_VERSION}/hotspot")
|
||||
download_with_retries "https://api.adoptium.net/v3/assets/latest/${JAVA_VERSION}/hotspot" "/tmp" "openjdk-hotspot.json"
|
||||
|
||||
if [[ $arch == "arm64" ]]; then
|
||||
asset=$(echo ${assetUrl} | jq -r '.[] | select(.binary.os=="mac" and .binary.image_type=="jdk" and .binary.architecture=="aarch64")')
|
||||
asset=$(jq -r '.[] | select(.binary.os=="mac" and .binary.image_type=="jdk" and .binary.architecture=="aarch64")' /tmp/openjdk-hotspot.json)
|
||||
else
|
||||
asset=$(echo ${assetUrl} | jq -r '.[] | select(.binary.os=="mac" and .binary.image_type=="jdk" and .binary.architecture=="x64")')
|
||||
asset=$(jq -r '.[] | select(.binary.os=="mac" and .binary.image_type=="jdk" and .binary.architecture=="x64")' /tmp/openjdk-hotspot.json)
|
||||
fi
|
||||
|
||||
archivePath=$(echo ${asset} | jq -r '.binary.package.link')
|
||||
|
||||
Reference in New Issue
Block a user