[macOS] Refactor the rest of the scripts (#9113)

* [macOS] Refactor the rest of the scripts

* Return quotes to config tccdb script

* Return quotes to config tccdb script

* Revert some changes in ruby scripts

* Revert some changes in ruby scripts

* Revert some changes chrome script

* check errors

* check errors 01

* find errors in common-utils

* find errors in edge install

* find errors in edge install

---------

Co-authored-by: Alexey Ayupov <“alexey.ayupov@akvelon.com”>
This commit is contained in:
Alexey-Ayupov
2024-01-09 14:47:31 +01:00
committed by GitHub
parent 5bdda2e8c2
commit 5a6e215859
48 changed files with 203 additions and 264 deletions

View File

@@ -11,7 +11,7 @@ LICENSE_BLOCK
USERNAME="${1}" USERNAME="${1}"
PW="${2}" PW="${2}"
function kcpasswordEncode { kcpasswordEncode() {
#ascii string #ascii string
local thisString="${1}" local thisString="${1}"
local i local i

View File

@@ -31,7 +31,7 @@ change_framework_version() {
local framework_path=$(get_framework_path "$framework") local framework_path=$(get_framework_path "$framework")
if [ -d "${framework_path}/${version}" ]; then if [ -d "${framework_path}/${version}" ]; then
sudo rm -f "${framework_path}/Current" sudo rm -f ${framework_path}/Current
sudo ln -s "${framework_path}/${version}" "${framework_path}/Current" sudo ln -s "${framework_path}/${version}" "${framework_path}/Current"
else else
echo "Invalid framework version ${framework_path}/${version}" echo "Invalid framework version ${framework_path}/${version}"

View File

@@ -14,7 +14,7 @@ scutil --set LocalHostName $name
scutil --set ComputerName "${name}.local" scutil --set ComputerName "${name}.local"
EOF EOF
chmod +x "/usr/local/bin/change_hostname.sh" chmod +x /usr/local/bin/change_hostname.sh
sudo tee -a /Library/LaunchDaemons/change_hostname.plist > /dev/null <<\EOF sudo tee -a /Library/LaunchDaemons/change_hostname.plist > /dev/null <<\EOF
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>

View File

@@ -22,7 +22,7 @@ if is_Veertu; then
fi fi
# Change screen resolution to the maximum supported for 4Mb video memory # Change screen resolution to the maximum supported for 4Mb video memory
if [ -d "/Library/Application Support/VMware Tools" ]; then if [[ -d "/Library/Application Support/VMware Tools" ]]; then
sudo "/Library/Application Support/VMware Tools/vmware-resolutionSet" 1176 885 sudo "/Library/Application Support/VMware Tools/vmware-resolutionSet" 1176 885
fi fi
@@ -60,7 +60,7 @@ rm -f ./add-certificate
# enable-automationmode-without-authentication # enable-automationmode-without-authentication
if ! is_BigSur; then if ! is_BigSur; then
retry=10 retry=10
while [ $retry -gt 0 ]; do while [[ $retry -gt 0 ]]; do
{ {
osascript <<EOF osascript <<EOF
tell application "Terminal" tell application "Terminal"
@@ -77,7 +77,7 @@ EOF
} && break } && break
retry=$((retry-1)) retry=$((retry-1))
if [ $retry -eq 0 ]; then if [[ $retry -eq 0 ]]; then
echo "No retry attempts left" echo "No retry attempts left"
exit 1 exit 1
fi fi
@@ -97,7 +97,7 @@ done
fi fi
# Create symlink for tests running # Create symlink for tests running
if [ ! -d "/usr/local/bin" ];then if [[ ! -d "/usr/local/bin" ]];then
sudo mkdir -p -m 775 /usr/local/bin sudo mkdir -p -m 775 /usr/local/bin
sudo chown $USER:admin /usr/local/bin sudo chown $USER:admin /usr/local/bin
fi fi

View File

@@ -8,7 +8,7 @@ Launch_Daemons="/Library/LaunchDaemons"
# EOF in quotes to disable variable expansion # EOF in quotes to disable variable expansion
echo "Creating limit.maxfiles.plist" echo "Creating limit.maxfiles.plist"
cat > "${Launch_Daemons}/limit.maxfiles.plist" << EOF cat > ${Launch_Daemons}/limit.maxfiles.plist << EOF
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@@ -28,17 +28,17 @@ EOF
# Creating script for applying workaround https://developer.apple.com/forums/thread/735798 # Creating script for applying workaround https://developer.apple.com/forums/thread/735798
cat > "/Users/runner/limit-maxfiles.sh" << EOF cat > /Users/runner/limit-maxfiles.sh << EOF
#!/bin/bash #!/bin/bash
sudo launchctl limit maxfiles 256 unlimited sudo launchctl limit maxfiles 256 unlimited
sudo launchctl limit maxfiles 65536 524288 sudo launchctl limit maxfiles 65536 524288
EOF EOF
echo "limit.maxfiles.sh permissions changing" echo "limit.maxfiles.sh permissions changing"
chmod +x "/Users/runner/limit-maxfiles.sh" chmod +x /Users/runner/limit-maxfiles.sh
echo "limit.maxfiles.plist permissions changing" echo "limit.maxfiles.plist permissions changing"
chown root:wheel "${Launch_Daemons}/limit.maxfiles.plist" chown root:wheel "${Launch_Daemons}/limit.maxfiles.plist"
chmod 0644 "${Launch_Daemons}/limit.maxfiles.plist" chmod 0644 ${Launch_Daemons}/limit.maxfiles.plist
echo "Done, limit.maxfiles has been updated" echo "Done, limit.maxfiles has been updated"

View File

@@ -7,7 +7,7 @@
################################################################################ ################################################################################
PLIST=/Library/LaunchDaemons/sonoma.detectnewhardware.plist PLIST=/Library/LaunchDaemons/sonoma.detectnewhardware.plist
cat <<EOF > "${PLIST}" cat <<EOF > ${PLIST}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
@@ -27,8 +27,8 @@ EOF
# These should be already set as follows, but since they're required # These should be already set as follows, but since they're required
# in order to load properly, we set them explicitly. # in order to load properly, we set them explicitly.
/bin/chmod 644 "${PLIST}" /bin/chmod 644 ${PLIST}
/usr/sbin/chown root:wheel "${PLIST}" /usr/sbin/chown root:wheel ${PLIST}
: ' : '
The MIT License (MIT) The MIT License (MIT)

View File

@@ -15,5 +15,5 @@ server time.windows.com
EOF EOF
# Set the timezone to UTC. # Set the timezone to UTC.
echo The Timezone setting to UTC... echo "The Timezone setting to UTC..."
ln -sf /usr/share/zoneinfo/UTC /etc/localtime ln -sf /usr/share/zoneinfo/UTC /etc/localtime

View File

@@ -5,7 +5,7 @@
################################################################################ ################################################################################
# set screensaver idleTime to 0, to prevent turning screensaver on # set screensaver idleTime to 0, to prevent turning screensaver on
macUUID=`ioreg -rd1 -c IOPlatformExpertDevice | grep -i "UUID" | cut -c27-62` macUUID=$(ioreg -rd1 -c IOPlatformExpertDevice | grep -i "UUID" | cut -c27-62)
rm -rf /Users/$USERNAME/Library/Preferences/com.apple.screensaver.$macUUID.plist rm -rf /Users/$USERNAME/Library/Preferences/com.apple.screensaver.$macUUID.plist
rm -rf /Users/$USERNAME/Library/Preferences/ByHost/com.apple.screensaver.$macUUID.plist rm -rf /Users/$USERNAME/Library/Preferences/ByHost/com.apple.screensaver.$macUUID.plist

View File

@@ -22,13 +22,13 @@ while [[ $retry -gt 0 ]]; do
fi fi
sleep 30 sleep 30
done done
IFS=',' read -r -a windowslist <<< "$openwindows" IFS=',' read -r -a windowslist <<< $openwindows
if [ -n "${openwindows}" ]; then if [[ -n ${openwindows} ]]; then
echo "Found opened window:" echo "Found opened window:"
fi fi
for window in "${windowslist[@]}"; do for window in ${windowslist[@]}; do
if [[ $window =~ "NotificationCenter" ]]; then if [[ $window =~ "NotificationCenter" ]]; then
echo "[Warning] $window" echo "[Warning] $window"
else else
@@ -37,6 +37,6 @@ for window in "${windowslist[@]}"; do
fi fi
done done
if [ "${scripterror}" = true ]; then if [[ ${scripterror} = true ]]; then
exit 1 exit 1
fi fi

View File

@@ -1,19 +0,0 @@
#!/bin/bash -e -o pipefail
################################################################################
## File: configure-xcode-symlinks.sh
## Desc: Link the existing Xcodes into the correct location for provisionator.
## This is maintained for backwards compatibility only. Do not add new xcodes here.
################################################################################
source ~/utils/utils.sh
ln -sf /Applications/Xcode_8.app /Applications/Xcode8.app
ln -sf /Applications/Xcode_8.1.app /Applications/Xcode81.app
ln -sf /Applications/Xcode_9.app /Applications/Xcode9.app
ln -sf /Applications/Xcode_9.1.app /Applications/Xcode91.app
ln -sf /Applications/Xcode_9.2.app /Applications/Xcode92.app
ln -sf /Applications/Xcode_9.3.app /Applications/Xcode93.app
ln -sf /Applications/Xcode_9.3.app /Applications/Xcode_9.3_beta.app
ln -sf /Applications/Xcode_9.4.app /Applications/Xcode_9.4-beta.app
ln -sf /Applications/Xcode_9.4.app /Applications/Xcode_9.4_beta.app
ln -sf /Applications/Xcode_9.4.app /Applications/Xcode_9.4_beta_2.app

View File

@@ -13,15 +13,14 @@ DEFAULT_XCODE_VERSION=$(get_toolset_value '.xcode.default')
# Assets.xcassets : error : CoreData: error: (6922) I/O error for database # Assets.xcassets : error : CoreData: error: (6922) I/O error for database
# at $HOME/Library/Developer/Xcode/UserData/IB Support/Simulator Devices/{GUID} # at $HOME/Library/Developer/Xcode/UserData/IB Support/Simulator Devices/{GUID}
echo "Erase a device's contents and settings:" echo "Erase a device's contents and settings:"
for XCODE_VERSION in "${XCODE_LIST[@]}" for XCODE_VERSION in ${XCODE_LIST[@]}; do
do
echo " Xcode Version: ${XCODE_VERSION}" echo " Xcode Version: ${XCODE_VERSION}"
launchctl remove com.apple.CoreSimulator.CoreSimulatorService || true launchctl remove com.apple.CoreSimulator.CoreSimulatorService || true
#add sleep to let CoreSimulatorService to exit #add sleep to let CoreSimulatorService to exit
sleep 3 sleep 3
# Select xcode version by default # Select xcode version by default
sudo xcode-select -s "/Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer" sudo xcode-select -s /Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer
# Erase a device's contents and settings # Erase a device's contents and settings
xcrun simctl erase all xcrun simctl erase all
@@ -32,4 +31,4 @@ done
# Select xcode version by default # Select xcode version by default
echo "Setting Xcode ${DEFAULT_XCODE_VERSION} as default" echo "Setting Xcode ${DEFAULT_XCODE_VERSION} as default"
sudo xcode-select -s "/Applications/Xcode_${DEFAULT_XCODE_VERSION}.app/Contents/Developer" sudo xcode-select -s /Applications/Xcode_${DEFAULT_XCODE_VERSION}.app/Contents/Developer

View File

@@ -8,13 +8,13 @@
source ~/utils/utils.sh source ~/utils/utils.sh
echo "Check if ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE folder exist..." echo "Check if ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE folder exist..."
if [ ! -d $ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE ]; then if [[ ! -d $ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE ]]; then
mkdir -p $ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE mkdir -p $ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE
fi fi
download_url=$(resolve_github_release_asset_url "actions/action-versions" "contains(\"action-versions.tar.gz\")" "latest") download_url=$(resolve_github_release_asset_url "actions/action-versions" "contains(\"action-versions.tar.gz\")" "latest")
echo "Downloading action-versions $download_url" echo "Downloading action-versions $download_url"
archive_path=$(download_with_retry "$download_url") archive_path=$(download_with_retry $download_url)
tar -xzf "$archive_path" -C "$ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE" tar -xzf $archive_path -C $ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE
invoke_tests "ActionArchiveCache" invoke_tests "ActionArchiveCache"

View File

@@ -6,39 +6,37 @@
source ~/utils/utils.sh source ~/utils/utils.sh
function filter_components_by_version { add_filtered_instalaltion_components() {
minimumVersion=$1 local minimum_version=$1
shift shift
toolsArr=("$@") local tools_array=("$@")
for item in ${toolsArr[@]} for item in ${tools_array[@]}; do
do
# take the last argument after spliting string by ';'' and '-'' # take the last argument after spliting string by ';'' and '-''
version=$(echo "${item##*[-;]}") version=$(echo "${item##*[-;]}")
if verlte $minimumVersion $version if [[ "$(printf "${minimum_version}\n${version}\n" | sort -V | head -n1)" == "$minimum_version" ]]; then
then
components+=($item) components+=($item)
fi fi
done done
} }
function get_full_ndk_version { get_full_ndk_version() {
majorVersion=$1 local majorVersion=$1
ndkVersion=$(${SDKMANAGER} --list | grep "ndk;${majorVersion}.*" | awk '{gsub("ndk;", ""); print $1}' | sort -V | tail -n1)
ndkVersion=$(${SDKMANAGER} --list | grep "ndk;${majorVersion}.*" | awk '{gsub("ndk;", ""); print $1}' | sort -V | tail -n1)
echo "$ndkVersion" echo "$ndkVersion"
} }
components=() components=()
ANDROID_PLATFORM=$(get_toolset_value '.android.platform_min_version') android_platform=$(get_toolset_value '.android.platform_min_version')
ANDROID_BUILD_TOOL=$(get_toolset_value '.android.build_tools_min_version') android_build_tool=$(get_toolset_value '.android.build_tools_min_version')
ANDROID_EXTRA_LIST=($(get_toolset_value '.android."extras"[]')) android_extra_list=($(get_toolset_value '.android."extras"[]'))
ANDROID_ADDON_LIST=($(get_toolset_value '.android."addons"[]')) android_addon_list=($(get_toolset_value '.android."addons"[]'))
ANDROID_ADDITIONAL_TOOLS=($(get_toolset_value '.android."additional_tools"[]')) android_additional_tools=($(get_toolset_value '.android."additional_tools"[]'))
ANDROID_NDK_MAJOR_VERSIONS=($(get_toolset_value '.android.ndk."versions"[]')) android_ndk_major_versions=($(get_toolset_value '.android.ndk."versions"[]'))
ANDROID_NDK_MAJOR_DEFAULT=$(get_toolset_value '.android.ndk.default') android_ndk_major_default=$(get_toolset_value '.android.ndk.default')
ANDROID_NDK_MAJOR_LATEST=$(get_toolset_value '.android.ndk."versions"[-1]') android_ndk_major_latest=$(get_toolset_value '.android.ndk."versions"[-1]')
# Get the latest command line tools from https://developer.android.com/studio#cmdline-tools # Get the latest command line tools from https://developer.android.com/studio#cmdline-tools
# Newer version(s) require Java 11 by default # Newer version(s) require Java 11 by default
# See https://github.com/actions/runner-images/issues/6960 # See https://github.com/actions/runner-images/issues/6960
@@ -81,15 +79,15 @@ echo "Installing latest tools & platform tools..."
echo y | $SDKMANAGER "tools" "platform-tools" echo y | $SDKMANAGER "tools" "platform-tools"
echo "Installing latest ndk..." echo "Installing latest ndk..."
for ndk_version in "${ANDROID_NDK_MAJOR_VERSIONS[@]}" for ndk_version in "${android_ndk_major_versions[@]}"
do do
ndk_full_version=$(get_full_ndk_version $ndk_version) ndk_full_version=$(get_full_ndk_version $ndk_version)
echo y | $SDKMANAGER "ndk;$ndk_full_version" echo y | $SDKMANAGER "ndk;$ndk_full_version"
done done
ndkDefault=$(get_full_ndk_version $ANDROID_NDK_MAJOR_DEFAULT) ndkDefault=$(get_full_ndk_version $android_ndk_major_default)
ANDROID_NDK_HOME=$ANDROID_HOME/ndk/$ndkDefault ANDROID_NDK_HOME=$ANDROID_HOME/ndk/$ndkDefault
ndkLatest=$(get_full_ndk_version $ANDROID_NDK_MAJOR_LATEST) ndkLatest=$(get_full_ndk_version $android_ndk_major_latest)
ANDROID_NDK_LATEST_HOME=$ANDROID_HOME/ndk/$ndkLatest ANDROID_NDK_LATEST_HOME=$ANDROID_HOME/ndk/$ndkLatest
# ANDROID_NDK, ANDROID_NDK_HOME, and ANDROID_NDK_ROOT variables should be set as many customer builds depend on them https://github.com/actions/runner-images/issues/5879 # ANDROID_NDK, ANDROID_NDK_HOME, and ANDROID_NDK_ROOT variables should be set as many customer builds depend on them https://github.com/actions/runner-images/issues/5879
echo "export ANDROID_NDK=$ANDROID_NDK_HOME" >> "${HOME}/.bashrc" echo "export ANDROID_NDK=$ANDROID_NDK_HOME" >> "${HOME}/.bashrc"
@@ -98,27 +96,27 @@ echo "export ANDROID_NDK_ROOT=$ANDROID_NDK_HOME" >> "${HOME}/.bashrc"
echo "export ANDROID_NDK_LATEST_HOME=$ANDROID_NDK_LATEST_HOME" >> "${HOME}/.bashrc" echo "export ANDROID_NDK_LATEST_HOME=$ANDROID_NDK_LATEST_HOME" >> "${HOME}/.bashrc"
availablePlatforms=($($SDKMANAGER --list | grep "platforms;android-[0-9]" | cut -d"|" -f 1 | sort -u)) availablePlatforms=($($SDKMANAGER --list | grep "platforms;android-[0-9]" | cut -d"|" -f 1 | sort -u))
filter_components_by_version $ANDROID_PLATFORM "${availablePlatforms[@]}" add_filtered_instalaltion_components $android_platform "${availablePlatforms[@]}"
allBuildTools=($($SDKMANAGER --list --include_obsolete | grep "build-tools;" | cut -d"|" -f 1 | sort -u)) allBuildTools=($($SDKMANAGER --list --include_obsolete | grep "build-tools;" | cut -d"|" -f 1 | sort -u))
availableBuildTools=$(echo ${allBuildTools[@]//*rc[0-9]/}) availableBuildTools=$(echo ${allBuildTools[@]//*rc[0-9]/})
filter_components_by_version $ANDROID_BUILD_TOOL "${availableBuildTools[@]}" add_filtered_instalaltion_components $android_build_tool "${availableBuildTools[@]}"
echo "y" | $SDKMANAGER ${components[@]} echo "y" | $SDKMANAGER ${components[@]}
for extra_name in "${ANDROID_EXTRA_LIST[@]}" for extra_name in "${android_extra_list[@]}"
do do
echo "Installing extra $extra_name ..." echo "Installing extra $extra_name ..."
echo y | $SDKMANAGER "extras;$extra_name" echo y | $SDKMANAGER "extras;$extra_name"
done done
for addon_name in "${ANDROID_ADDON_LIST[@]}" for addon_name in "${android_addon_list[@]}"
do do
echo "Installing add-on $addon_name ..." echo "Installing add-on $addon_name ..."
echo y | $SDKMANAGER "add-ons;$addon_name" echo y | $SDKMANAGER "add-ons;$addon_name"
done done
for tool_name in "${ANDROID_ADDITIONAL_TOOLS[@]}" for tool_name in "${android_additional_tools[@]}"
do do
echo "Installing additional tool $tool_name ..." echo "Installing additional tool $tool_name ..."
echo y | $SDKMANAGER "$tool_name" echo y | $SDKMANAGER "$tool_name"

View File

@@ -6,11 +6,11 @@
source ~/utils/utils.sh source ~/utils/utils.sh
echo Installing aws... echo "Installing aws..."
awscliv2_pkg_path=$(download_with_retry "https://awscli.amazonaws.com/AWSCLIV2.pkg") awscliv2_pkg_path=$(download_with_retry "https://awscli.amazonaws.com/AWSCLIV2.pkg")
sudo installer -pkg "$awscliv2_pkg_path" -target / sudo installer -pkg "$awscliv2_pkg_path" -target /
echo Installing aws sam cli... echo "Installing aws sam cli..."
brew tap aws/tap brew tap aws/tap
brew_smart_install aws-sam-cli brew_smart_install aws-sam-cli

View File

@@ -15,11 +15,11 @@ else
fi fi
# Install AzCopy # Install AzCopy
archive_path=$(download_with_retry "${url}") archive_path=$(download_with_retry ${url})
unzip -qq "$archive_path" -d /tmp/azcopy unzip -qq $archive_path -d /tmp/azcopy
extract_path=$(echo /tmp/azcopy/azcopy*) extract_path=$(echo /tmp/azcopy/azcopy*)
cp "$extract_path/azcopy" "/usr/local/bin/azcopy" cp $extract_path/azcopy /usr/local/bin/azcopy
chmod +x "/usr/local/bin/azcopy" chmod +x /usr/local/bin/azcopy
invoke_tests "Common" "AzCopy" invoke_tests "Common" "AzCopy"

View File

@@ -6,7 +6,7 @@
source ~/utils/utils.sh source ~/utils/utils.sh
echo Installing bicep cli... echo "Installing bicep cli..."
brew tap azure/bicep brew tap azure/bicep
brew_smart_install bicep brew_smart_install bicep

View File

@@ -19,32 +19,32 @@ echo "Google Chrome version is $full_chrome_version"
# Get Google Chrome versions information # Get Google Chrome versions information
chrome_platform="mac-$arch" chrome_platform="mac-$arch"
CHROME_VERSIONS_URL="https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build-with-downloads.json" CHROME_VERSIONS_URL="https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build-with-downloads.json"
chrome_versions_json="$(cat "$(download_with_retry "$CHROME_VERSIONS_URL")")" chrome_versions_json="$(cat $(download_with_retry "$CHROME_VERSIONS_URL"))"
# Download and unpack the latest release of Chrome Driver # Download and unpack the latest release of Chrome Driver
chromedriver_version=$(echo "${chrome_versions_json}" | jq -r '.builds["'"$chrome_version"'"].version') chromedriver_version=$(echo $chrome_versions_json | jq -r '.builds["'"$chrome_version"'"].version')
echo "Installing Chrome Driver version $chromedriver_version" echo "Installing Chrome Driver version $chromedriver_version"
chromedriver_url=$(echo "${chrome_versions_json}" | jq -r '.builds["'"$chrome_version"'"].downloads.chromedriver[] | select(.platform=="'"${chrome_platform}"'").url') chromedriver_url=$(echo $chrome_versions_json | jq -r '.builds["'"$chrome_version"'"].downloads.chromedriver[] | select(.platform=="'"${chrome_platform}"'").url')
chromedriver_dir="/usr/local/share/chromedriver-${chrome_platform}" chromedriver_dir="/usr/local/share/chromedriver-$chrome_platform"
chromedriver_bin="$chromedriver_dir/chromedriver" chromedriver_bin="$chromedriver_dir/chromedriver"
chromedriver_archive_path=$(download_with_retry "$chromedriver_url") chromedriver_archive_path=$(download_with_retry $chromedriver_url)
unzip -qq "$chromedriver_archive_path" -d /tmp/ unzip -qq $chromedriver_archive_path -d /tmp/
sudo mv "/tmp/chromedriver-${chrome_platform}" "$chromedriver_dir" sudo mv /tmp/chromedriver-$chrome_platform $chromedriver_dir
ln -s "$chromedriver_bin" /usr/local/bin/chromedriver ln -s $chromedriver_bin /usr/local/bin/chromedriver
echo "export CHROMEWEBDRIVER=$chromedriver_dir" >> "${HOME}/.bashrc" echo "export CHROMEWEBDRIVER=$chromedriver_dir" >> ${HOME}/.bashrc
# Download and unpack the latest release of Google Chrome for Testing # Download and unpack the latest release of Google Chrome for Testing
chrome_for_testing_version=$(echo "${chrome_versions_json}" | jq -r '.builds["'"$chrome_version"'"].version') chrome_for_testing_version=$(echo $chrome_versions_json | jq -r '.builds["'"$chrome_version"'"].version')
echo "Installing Google Chrome for Testing version $chrome_for_testing_version" echo "Installing Google Chrome for Testing version $chrome_for_testing_version"
chrome_for_testing_url=$(echo "${chrome_versions_json}" | jq -r '.builds["'"$chrome_version"'"].downloads.chrome[] | select(.platform=="'"${chrome_platform}"'").url') chrome_for_testing_url=$(echo $chrome_versions_json | jq -r '.builds["'"$chrome_version"'"].downloads.chrome[] | select(.platform=="'"${chrome_platform}"'").url')
chrome_for_testing_app="Google Chrome for Testing.app" chrome_for_testing_app="Google Chrome for Testing.app"
chrome_for_testing_archive_path=$(download_with_retry "$chrome_for_testing_url") chrome_for_testing_archive_path=$(download_with_retry $chrome_for_testing_url)
unzip -qq "$chrome_for_testing_archive_path" -d /tmp/ unzip -qq $chrome_for_testing_archive_path -d /tmp/
mv "/tmp/chrome-${chrome_platform}/${chrome_for_testing_app}" "/Applications/${chrome_for_testing_app}" mv "/tmp/chrome-$chrome_platform/$chrome_for_testing_app" "/Applications/$chrome_for_testing_app"
echo "Installing Selenium" echo "Installing Selenium"
brew_smart_install "selenium-server" brew_smart_install "selenium-server"

View File

@@ -8,7 +8,7 @@ source ~/utils/utils.sh
# Retrieve the CLI version of the latest CodeQL bundle. # Retrieve the CLI version of the latest CodeQL bundle.
defaults_json_path=$(download_with_retry https://raw.githubusercontent.com/github/codeql-action/v2/src/defaults.json) defaults_json_path=$(download_with_retry https://raw.githubusercontent.com/github/codeql-action/v2/src/defaults.json)
bundle_version="$(jq -r '.cliVersion' "$defaults_json_path")" bundle_version=$(jq -r '.cliVersion' $defaults_json_path)
bundle_tag_name="codeql-bundle-v$bundle_version" bundle_tag_name="codeql-bundle-v$bundle_version"
echo "Downloading CodeQL bundle $bundle_version..." echo "Downloading CodeQL bundle $bundle_version..."
@@ -16,17 +16,17 @@ echo "Downloading CodeQL bundle $bundle_version..."
# different operating systems within containers. # different operating systems within containers.
archive_path=$(download_with_retry "https://github.com/github/codeql-action/releases/download/$bundle_tag_name/codeql-bundle.tar.gz") archive_path=$(download_with_retry "https://github.com/github/codeql-action/releases/download/$bundle_tag_name/codeql-bundle.tar.gz")
codeql_toolcache_path="$AGENT_TOOLSDIRECTORY/CodeQL/$bundle_version/x64" codeql_toolcache_path=$AGENT_TOOLSDIRECTORY/CodeQL/$bundle_version/x64
mkdir -p "$codeql_toolcache_path" mkdir -p $codeql_toolcache_path
echo "Unpacking the downloaded CodeQL bundle archive..." echo "Unpacking the downloaded CodeQL bundle archive..."
tar -xzf "$archive_path" -C "$codeql_toolcache_path" tar -xzf $archive_path -C $codeql_toolcache_path
# Touch a file to indicate to the CodeQL Action that this bundle shipped with the toolcache. This is # Touch a file to indicate to the CodeQL Action that this bundle shipped with the toolcache. This is
# to support overriding the CodeQL version specified in defaults.json on GitHub Enterprise. # to support overriding the CodeQL version specified in defaults.json on GitHub Enterprise.
touch "$codeql_toolcache_path/pinned-version" touch $codeql_toolcache_path/pinned-version
# Touch a file to indicate to the toolcache that setting up CodeQL is complete. # Touch a file to indicate to the toolcache that setting up CodeQL is complete.
touch "$codeql_toolcache_path.complete" touch $codeql_toolcache_path.complete
invoke_tests "Common" "CodeQL Bundle" invoke_tests "Common" "CodeQL Bundle"

View File

@@ -28,9 +28,9 @@ for package in $cask_packages; do
# Do not update VirtualBox on macOS 12 due to the issue with VMs in gurumediation state which blocks Vagrant on macOS: https://github.com/actions/runner-images/issues/8730 # Do not update VirtualBox on macOS 12 due to the issue with VMs in gurumediation state which blocks Vagrant on macOS: https://github.com/actions/runner-images/issues/8730
# macOS host: Dropped all kernel extensions. VirtualBox relies fully on the hypervisor and vmnet frameworks provided by Apple now. # macOS host: Dropped all kernel extensions. VirtualBox relies fully on the hypervisor and vmnet frameworks provided by Apple now.
virtualbox_cask_path=$(download_with_retry "https://raw.githubusercontent.com/Homebrew/homebrew-cask/aa3c55951fc9d687acce43e5c0338f42c1ddff7b/Casks/virtualbox.rb") virtualbox_cask_path=$(download_with_retry "https://raw.githubusercontent.com/Homebrew/homebrew-cask/aa3c55951fc9d687acce43e5c0338f42c1ddff7b/Casks/virtualbox.rb")
brew install "$virtualbox_cask_path" brew install $virtualbox_cask_path
else else
brew install --cask "$package" brew install --cask $package
fi fi
done done
@@ -51,7 +51,7 @@ if is_Monterey; then
osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD
} && break } && break
if [[ "$retry" -eq 0 ]]; then if [[ $retry -eq 0 ]]; then
echo "Executing AppleScript failed. No retries left" echo "Executing AppleScript failed. No retries left"
exit 1 exit 1
fi fi
@@ -75,23 +75,20 @@ if is_Monterey; then
dbQuery="SELECT * FROM kext_policy WHERE bundle_id LIKE 'com.parallels.kext.%';" dbQuery="SELECT * FROM kext_policy WHERE bundle_id LIKE 'com.parallels.kext.%';"
kext=$(sudo sqlite3 $dbName "$dbQuery") kext=$(sudo sqlite3 $dbName "$dbQuery")
if [[ -z "$kext" ]]; then if [[ -z $kext ]]; then
echo "Parallels International GmbH not found" echo "Parallels International GmbH not found"
exit 1 exit 1
fi fi
# Create env variable # Create env variable
url=$(brew info --json=v2 --installed | jq -r '.casks[] | select(.name[] == "Parallels Desktop").url') url=$(brew info --json=v2 --installed | jq -r '.casks[] | select(.name[] == "Parallels Desktop").url')
if [[ -z "$url" ]]; then if [[ -z $url ]]; then
echo "Unable to parse url for Parallels Desktop cask" echo "Unable to parse url for Parallels Desktop cask"
exit 1 exit 1
fi fi
echo "export PARALLELS_DMG_URL=$url" >> "${HOME}/.bashrc" echo "export PARALLELS_DMG_URL=$url" >> ${HOME}/.bashrc
fi fi
# Invoke bazel to download bazel version via bazelisk
bazel
# Install Azure DevOps extension for Azure Command Line Interface # Install Azure DevOps extension for Azure Command Line Interface
az extension add -n azure-devops az extension add -n azure-devops

View File

@@ -13,32 +13,32 @@ arch=$(get_arch)
# Download installer from dot.net and keep it locally # Download installer from dot.net and keep it locally
DOTNET_INSTALL_SCRIPT="https://dot.net/v1/dotnet-install.sh" DOTNET_INSTALL_SCRIPT="https://dot.net/v1/dotnet-install.sh"
install_script_path=$(download_with_retry $DOTNET_INSTALL_SCRIPT) install_script_path=$(download_with_retry $DOTNET_INSTALL_SCRIPT)
chmod +x "$install_script_path" chmod +x $install_script_path
args_list=() args_list=()
echo "Parsing dotnet SDK (except rc and preview versions) from .json..." echo "Parsing dotnet SDK (except rc and preview versions) from .json..."
dotnet_versions=($(get_toolset_value ".dotnet.arch[\"$arch\"].versions | .[]")) dotnet_versions=($(get_toolset_value ".dotnet.arch[\"$arch\"].versions | .[]"))
for dotnet_version in "${dotnet_versions[@]}"; do for dotnet_version in ${dotnet_versions[@]}; do
release_url="https://raw.githubusercontent.com/dotnet/core/main/release-notes/${dotnet_version}/releases.json" release_url="https://raw.githubusercontent.com/dotnet/core/main/release-notes/${dotnet_version}/releases.json"
releases_json_file=$(download_with_retry "$release_url") releases_json_file=$(download_with_retry "$release_url")
if [[ $dotnet_version == "6.0" ]]; then if [[ $dotnet_version == "6.0" ]]; then
args_list+=( args_list+=(
$(cat "$releases_json_file" | jq -r 'first(.releases[].sdks[]?.version | select(contains("preview") or contains("rc") | not))') $(cat $releases_json_file | jq -r 'first(.releases[].sdks[]?.version | select(contains("preview") or contains("rc") | not))')
) )
else else
args_list+=( args_list+=(
$(cat "$releases_json_file" | \ $(cat $releases_json_file | \
jq -r '.releases[].sdk."version"' | grep -v -E '\-(preview|rc)\d*' | \ jq -r '.releases[].sdk."version"' | grep -v -E '\-(preview|rc)\d*' | \
sort -r | rev | uniq -s 2 | rev) sort -r | rev | uniq -s 2 | rev)
) )
fi fi
done done
for ARGS in "${args_list[@]}"; do for ARGS in ${args_list[@]}; do
"$install_script_path" --version $ARGS -NoPath --arch $arch $install_script_path --version $ARGS -NoPath --arch $arch
done done
# dotnet installer doesn't create symlink to executable in /user/local/bin # dotnet installer doesn't create symlink to executable in /user/local/bin
@@ -46,12 +46,12 @@ done
ln -s ~/.dotnet/dotnet /usr/local/bin/dotnet ln -s ~/.dotnet/dotnet /usr/local/bin/dotnet
# Validate installation # Validate installation
if [ $(dotnet --list-sdks | wc -l) -lt "1" ]; then if [[ $(dotnet --list-sdks | wc -l) -lt "1" ]]; then
echo "The .NET Core SDK is not installed" echo "The .NET Core SDK is not installed"
exit 1 exit 1
fi fi
echo 'export PATH="$PATH:$HOME/.dotnet/tools"' >> "$HOME/.bashrc" echo 'export PATH="$PATH:$HOME/.dotnet/tools"' >> $HOME/.bashrc
echo "Dotnet operations have been completed successfully..." echo "Dotnet operations have been completed successfully..."
invoke_tests "Common" ".NET" invoke_tests "Common" ".NET"

View File

@@ -30,10 +30,10 @@ edge_driver_archive_path=$(download_with_retry "$edge_driver_url")
EDGE_DRIVER_DIR="/usr/local/share/edge_driver" EDGE_DRIVER_DIR="/usr/local/share/edge_driver"
mkdir -p $EDGE_DRIVER_DIR mkdir -p $EDGE_DRIVER_DIR
unzip -qq "$edge_driver_archive_path" -d "$EDGE_DRIVER_DIR" unzip -qq $edge_driver_archive_path -d $EDGE_DRIVER_DIR
ln -s "$EDGE_DRIVER_DIR/msedgedriver" "/usr/local/bin/msedgedriver" ln -s $EDGE_DRIVER_DIR/msedgedriver /usr/local/bin/msedgedriver
echo "export EDGEWEBDRIVER=${EDGE_DRIVER_DIR}" >> "${HOME}/.bashrc" echo "export EDGEWEBDRIVER=${EDGE_DRIVER_DIR}" >> ${HOME}/.bashrc
# Configure Edge Updater to prevent auto update # Configure Edge Updater to prevent auto update
# https://learn.microsoft.com/en-us/deployedge/edge-learnmore-edgeupdater-for-macos # https://learn.microsoft.com/en-us/deployedge/edge-learnmore-edgeupdater-for-macos

View File

@@ -14,6 +14,6 @@ brew_smart_install "geckodriver"
geckoPath="$(brew --prefix geckodriver)/bin" geckoPath="$(brew --prefix geckodriver)/bin"
echo "Add GECKOWEBDRIVER to bashrc..." echo "Add GECKOWEBDRIVER to bashrc..."
echo "export GECKOWEBDRIVER=${geckoPath}" >> "${HOME}/.bashrc" echo "export GECKOWEBDRIVER=${geckoPath}" >> ${HOME}/.bashrc
invoke_tests "Browsers" "Firefox" invoke_tests "Browsers" "Firefox"

View File

@@ -14,7 +14,7 @@ done
# Delete default gfortran link if it exists https://github.com/actions/runner-images/issues/1280 # Delete default gfortran link if it exists https://github.com/actions/runner-images/issues/1280
gfortranPath=$(which gfortran) || true gfortranPath=$(which gfortran) || true
if [ $gfortranPath ]; then if [[ $gfortranPath ]]; then
rm $gfortranPath rm $gfortranPath
fi fi

View File

@@ -6,12 +6,12 @@
source ~/utils/utils.sh source ~/utils/utils.sh
echo Installing Git... echo "Installing Git..."
brew_smart_install "git" brew_smart_install "git"
git config --global --add safe.directory "*" git config --global --add safe.directory "*"
echo Installing Git LFS echo "Installing Git LFS"
brew_smart_install "git-lfs" brew_smart_install "git-lfs"
# Update global git config # Update global git config
@@ -19,7 +19,7 @@ git lfs install
# Update system git config # Update system git config
sudo git lfs install --system sudo git lfs install --system
echo Disable all the Git help messages... echo "Disable all the Git help messages..."
git config --global advice.pushUpdateRejected false git config --global advice.pushUpdateRejected false
git config --global advice.pushNonFFCurrent false git config --global advice.pushNonFFCurrent false
git config --global advice.pushNonFFMatching false git config --global advice.pushNonFFMatching false

View File

@@ -6,9 +6,9 @@
source ~/utils/utils.sh source ~/utils/utils.sh
curl --proto '=https' --tlsv1.2 -fsSL https://get-ghcup.haskell.org | sh curl --proto '=https' --tlsv1.2 -fsSL https://get-ghcup.haskell.org | bash
export PATH="$HOME/.ghcup/bin:$PATH" export PATH="$HOME/.ghcup/bin:$PATH"
echo 'export PATH="$PATH:$HOME/.ghcup/bin"' >> "$HOME/.bashrc" echo 'export PATH="$PATH:$HOME/.ghcup/bin"' >> $HOME/.bashrc
# ghcup output looks like this "ghc 8.6.4 base-4.12.0.0 hls-powered", need to take all the first versions only(8.6.4 in that case) and avoid pre-release ones # ghcup output looks like this "ghc 8.6.4 base-4.12.0.0 hls-powered", need to take all the first versions only(8.6.4 in that case) and avoid pre-release ones
availableVersions=$(ghcup list -t ghc -r | grep -v "prerelease" | awk '{print $2}') availableVersions=$(ghcup list -t ghc -r | grep -v "prerelease" | awk '{print $2}')

View File

@@ -10,7 +10,7 @@ arch=$(get_arch)
echo "Installing Homebrew..." echo "Installing Homebrew..."
homebrew_installer_path=$(download_with_retry "https://raw.githubusercontent.com/Homebrew/install/master/install.sh") homebrew_installer_path=$(download_with_retry "https://raw.githubusercontent.com/Homebrew/install/master/install.sh")
/bin/bash "$homebrew_installer_path" /bin/bash $homebrew_installer_path
if [[ $arch == "arm64" ]]; then if [[ $arch == "arm64" ]]; then
/opt/homebrew/bin/brew update /opt/homebrew/bin/brew update

View File

@@ -7,16 +7,16 @@
source ~/utils/utils.sh source ~/utils/utils.sh
miniconda_installer_path=$(download_with_retry "https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh") miniconda_installer_path=$(download_with_retry "https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh")
chmod +x "$miniconda_installer_path" chmod +x $miniconda_installer_path
sudo "$miniconda_installer_path" -b -p /usr/local/miniconda sudo $miniconda_installer_path -b -p /usr/local/miniconda
# Chmod with full permissions recursively to avoid permissions restrictions # Chmod with full permissions recursively to avoid permissions restrictions
sudo chmod -R 777 /usr/local/miniconda sudo chmod -R 777 /usr/local/miniconda
sudo ln -s /usr/local/miniconda/bin/conda /usr/local/bin/conda sudo ln -s /usr/local/miniconda/bin/conda /usr/local/bin/conda
if [ -d "$HOME/.conda" ]; then if [[ -d $HOME/.conda ]]; then
sudo chown -R $USER "$HOME/.conda" sudo chown -R $USER $HOME/.conda
fi fi
echo "export CONDA=/usr/local/miniconda" >> $HOME/.bashrc echo "export CONDA=/usr/local/miniconda" >> $HOME/.bashrc

View File

@@ -14,10 +14,10 @@ toolsetVersion=$(get_toolset_value '.mongodb.version')
brew tap mongodb/brew brew tap mongodb/brew
versionToInstall=$(brew search --formulae /mongodb-community@$toolsetVersion/ | awk -F'/' '{print $3}' | tail -1) versionToInstall=$(brew search --formulae /mongodb-community@$toolsetVersion/ | awk -F'/' '{print $3}' | tail -1)
echo "Installing mongodb $versionToInstall" echo "Installing mongodb $versionToInstall"
brew_smart_install "$versionToInstall" brew_smart_install $versionToInstall
if ! which mongo ; then if ! which mongo ; then
brew link "$versionToInstall" brew link $versionToInstall
fi fi
invoke_tests "Databases" "MongoDB" invoke_tests "Databases" "MongoDB"

View File

@@ -9,28 +9,28 @@ source ~/utils/utils.sh
# Install Mono Framework # Install Mono Framework
mono_version_full=$(get_toolset_value '.mono.framework.version') mono_version_full=$(get_toolset_value '.mono.framework.version')
mono_pkg_sha256=$(get_toolset_value '.mono.framework.sha256') mono_pkg_sha256=$(get_toolset_value '.mono.framework.sha256')
mono_version=$(echo "$mono_version_full" | cut -d. -f 1,2,3) mono_version=$(echo $mono_version_full | cut -d. -f 1,2,3)
mono_version_short=$(echo $mono_version_full | cut -d. -f 1,2) mono_version_short=$(echo $mono_version_full | cut -d. -f 1,2)
mono_pkg_url="https://download.mono-project.com/archive/${mono_version}/macos-10-universal/MonoFramework-MDK-${mono_version_full}.macos10.xamarin.universal.pkg" mono_pkg_url="https://download.mono-project.com/archive/${mono_version}/macos-10-universal/MonoFramework-MDK-${mono_version_full}.macos10.xamarin.universal.pkg"
MONO_VERSIONS_PATH='/Library/Frameworks/Mono.framework/Versions' MONO_VERSIONS_PATH='/Library/Frameworks/Mono.framework/Versions'
mono_pkg_path=$(download_with_retry "$mono_pkg_url") mono_pkg_path=$(download_with_retry $mono_pkg_url)
use_checksum_comparison "$mono_pkg_path" "$mono_pkg_sha256" use_checksum_comparison $mono_pkg_path $mono_pkg_sha256
echo "Installing Mono Framework ${mono_version_full}..." echo "Installing Mono Framework ${mono_version_full}..."
sudo installer -pkg "$mono_pkg_path" -target / sudo installer -pkg $mono_pkg_path -target /
# Download and install NUnit console # Download and install NUnit console
nunit_version=$(get_toolset_value '.mono.nunit.version') nunit_version=$(get_toolset_value '.mono.nunit.version')
nunit_archive_url="https://github.com/nunit/nunit-console/releases/download/${nunit_version}/NUnit.Console-${nunit_version}.zip" nunit_archive_url="https://github.com/nunit/nunit-console/releases/download/${nunit_version}/NUnit.Console-${nunit_version}.zip"
nunit_archive_sha256=$(get_toolset_value '.mono.nunit.sha256') nunit_archive_sha256=$(get_toolset_value '.mono.nunit.sha256')
NUNIT_PATH="/Library/Developer/nunit" NUNIT_PATH="/Library/Developer/nunit"
nunit_version_path="$NUNIT_PATH/$nunit_version" nunit_version_path=$NUNIT_PATH/$nunit_version
nunit_archive_path=$(download_with_retry "$nunit_archive_url") nunit_archive_path=$(download_with_retry $nunit_archive_url)
use_checksum_comparison "$nunit_archive_path" "$nunit_archive_sha256" use_checksum_comparison $nunit_archive_path $nunit_archive_sha256
echo "Installing NUnit ${nunit_version}..." echo "Installing NUnit ${nunit_version}..."
sudo mkdir -p "$nunit_version_path" sudo mkdir -p $nunit_version_path
sudo unzip -q "$nunit_archive_path" -d "$nunit_version_path" sudo unzip -q $nunit_archive_path -d $nunit_version_path
# Create a wrapper script for nunit3-console # Create a wrapper script for nunit3-console
echo "Creating nunit3-console wrapper..." echo "Creating nunit3-console wrapper..."
@@ -39,13 +39,13 @@ cat <<EOF > "$nunit3_console_wrapper"
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
exec ${MONO_VERSIONS_PATH}/${mono_version}/bin/mono --debug \$MONO_OPTIONS $nunit_version_path/nunit3-console.exe "\$@" exec ${MONO_VERSIONS_PATH}/${mono_version}/bin/mono --debug \$MONO_OPTIONS $nunit_version_path/nunit3-console.exe "\$@"
EOF EOF
cat "$nunit3_console_wrapper" cat $nunit3_console_wrapper
sudo chmod +x "$nunit3_console_wrapper" sudo chmod +x $nunit3_console_wrapper
sudo mv "$nunit3_console_wrapper" "${MONO_VERSIONS_PATH}/${mono_version}/Commands/nunit3-console" sudo mv $nunit3_console_wrapper "${MONO_VERSIONS_PATH}/${mono_version}/Commands/nunit3-console"
# Create a symlink for the short version of Mono (e.g., 6.12) # Create a symlink for the short version of Mono (e.g., 6.12)
echo "Creating short symlink '${mono_version_short}'..." echo "Creating short symlink '${mono_version_short}'..."
sudo ln -s "${MONO_VERSIONS_PATH}/${mono_version}" "${MONO_VERSIONS_PATH}/${mono_version_short}" sudo ln -s ${MONO_VERSIONS_PATH}/${mono_version} ${MONO_VERSIONS_PATH}/${mono_version_short}
# Invoke tests for Xamarin and Mono # Invoke tests for Xamarin and Mono
invoke_tests "Xamarin" "Mono" invoke_tests "Xamarin" "Mono"

View File

@@ -14,7 +14,7 @@ brew link node@$defaultVersion --force --overwrite
echo Installing yarn... echo Installing yarn...
yarn_installer_path=$(download_with_retry "https://yarnpkg.com/install.sh") yarn_installer_path=$(download_with_retry "https://yarnpkg.com/install.sh")
bash "$yarn_installer_path" bash $yarn_installer_path
if is_BigSur || is_Monterey; then if is_BigSur || is_Monterey; then
npm_global_packages=$(get_toolset_value '.npm.global_packages[].name') npm_global_packages=$(get_toolset_value '.npm.global_packages[].name')

View File

@@ -6,12 +6,12 @@
source ~/utils/utils.sh source ~/utils/utils.sh
[ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}") [[ -n $API_PAT ]] && authString=(-H "Authorization: token ${API_PAT}")
nvm_version=$(curl "${authString[@]}" -fsSL https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name') nvm_version=$(curl "${authString[@]}" -fsSL https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
nvm_installer_path=$(download_with_retry "https://raw.githubusercontent.com/nvm-sh/nvm/$nvm_version/install.sh") nvm_installer_path=$(download_with_retry "https://raw.githubusercontent.com/nvm-sh/nvm/$nvm_version/install.sh")
if bash "$nvm_installer_path"; then if bash $nvm_installer_path; then
. ~/.bashrc source ~/.bashrc
nvm --version nvm --version
for version in $(get_toolset_value '.node.nvm_versions[]'); do for version in $(get_toolset_value '.node.nvm_versions[]'); do
nvm install "v${version}" nvm install "v${version}"

View File

@@ -18,15 +18,15 @@ createEnvironmentVariable() {
if [[ ${DEFAULT} == "True" ]]; then if [[ ${DEFAULT} == "True" ]]; then
echo "Setting up JAVA_HOME variable to ${INSTALL_PATH_PATTERN}" echo "Setting up JAVA_HOME variable to ${INSTALL_PATH_PATTERN}"
echo "export JAVA_HOME=${INSTALL_PATH_PATTERN}" >> "${HOME}/.bashrc" echo "export JAVA_HOME=${INSTALL_PATH_PATTERN}" >> ${HOME}/.bashrc
fi fi
if [[ $arch == "arm64" ]]; then if [[ $arch == "arm64" ]]; then
echo "Setting up JAVA_HOME_${JAVA_VERSION}_arm64 variable to ${INSTALL_PATH_PATTERN}" echo "Setting up JAVA_HOME_${JAVA_VERSION}_arm64 variable to ${INSTALL_PATH_PATTERN}"
echo "export JAVA_HOME_${JAVA_VERSION}_arm64=${INSTALL_PATH_PATTERN}" >> "${HOME}/.bashrc" echo "export JAVA_HOME_${JAVA_VERSION}_arm64=${INSTALL_PATH_PATTERN}" >> ${HOME}/.bashrc
else else
echo "Setting up JAVA_HOME_${JAVA_VERSION}_X64 variable to ${INSTALL_PATH_PATTERN}" echo "Setting up JAVA_HOME_${JAVA_VERSION}_X64 variable to ${INSTALL_PATH_PATTERN}"
echo "export JAVA_HOME_${JAVA_VERSION}_X64=${INSTALL_PATH_PATTERN}" >> "${HOME}/.bashrc" echo "export JAVA_HOME_${JAVA_VERSION}_X64=${INSTALL_PATH_PATTERN}" >> ${HOME}/.bashrc
fi fi
} }
@@ -58,12 +58,12 @@ installOpenJDK() {
fi fi
# Download and extract Java binaries # Download and extract Java binaries
archive_path=$(download_with_retry "$archive_url") archive_path=$(download_with_retry $archive_url)
echo "Creating ${javaToolcacheVersionArchPath} directory" echo "Creating ${javaToolcacheVersionArchPath} directory"
mkdir -p ${javaToolcacheVersionArchPath} mkdir -p ${javaToolcacheVersionArchPath}
tar -xf "$archive_path" -C ${javaToolcacheVersionArchPath} --strip-components=1 tar -xf $archive_path -C ${javaToolcacheVersionArchPath} --strip-components=1
# Create complete file # Create complete file
if [[ $arch == "arm64" ]]; then if [[ $arch == "arm64" ]]; then

View File

@@ -20,11 +20,11 @@ brew services start $postgreService
echo "Check PostgreSQL service is running" echo "Check PostgreSQL service is running"
i=10 i=10
COMMAND='pg_isready' COMMAND='pg_isready'
while [ $i -gt 0 ]; do while [[ $i -gt 0 ]]; do
echo "Check PostgreSQL service status" echo "Check PostgreSQL service status"
eval $COMMAND && break eval $COMMAND && break
((i--)) ((i--))
if [ $i == 0 ]; then if [[ $i == 0 ]]; then
echo "PostgreSQL service not ready, all attempts exhausted" echo "PostgreSQL service not ready, all attempts exhausted"
exit 1 exit 1
fi fi

View File

@@ -11,7 +11,7 @@ arch=$(get_arch)
metadata_json_path=$(download_with_retry "https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json") metadata_json_path=$(download_with_retry "https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json")
pwshVersionToolset=$(get_toolset_value '.pwsh.version') pwshVersionToolset=$(get_toolset_value '.pwsh.version')
pwshVersions=$(jq -r '.LTSReleaseTag[]' "$metadata_json_path") pwshVersions=$(jq -r '.LTSReleaseTag[]' $metadata_json_path)
for version in ${pwshVersions[@]}; do for version in ${pwshVersions[@]}; do
if [[ "$version" =~ "$pwshVersionToolset" ]]; then if [[ "$version" =~ "$pwshVersionToolset" ]]; then
@@ -20,19 +20,19 @@ for version in ${pwshVersions[@]}; do
fi fi
done done
pkg_path=$(download_with_retry "$download_url") pkg_path=$(download_with_retry $download_url)
# Work around the issue on macOS Big Sur 11.5 or higher for possible error message ("can't be opened because Apple cannot check it for malicious software") when installing the package # Work around the issue on macOS Big Sur 11.5 or higher for possible error message ("can't be opened because Apple cannot check it for malicious software") when installing the package
sudo xattr -rd com.apple.quarantine "$pkg_path" sudo xattr -rd com.apple.quarantine $pkg_path
sudo installer -pkg "$pkg_path" -target / sudo installer -pkg $pkg_path -target /
# Install PowerShell modules # Install PowerShell modules
psModules=$(get_toolset_value '.powershellModules[].name') psModules=$(get_toolset_value '.powershellModules[].name')
for module in ${psModules[@]}; do for module in ${psModules[@]}; do
echo "Installing $module module" echo "Installing $module module"
moduleVersions="$(get_toolset_value ".powershellModules[] | select(.name==\"$module\") | .versions[]?")" moduleVersions="$(get_toolset_value ".powershellModules[] | select(.name==\"$module\") | .versions[]?")"
if [[ -z "$moduleVersions" ]];then if [[ -z $moduleVersions ]];then
# Check MacOS architecture and sudo on Arm64 # Check MacOS architecture and sudo on Arm64
if [[ $arch == "arm64" ]]; then if [[ $arch == "arm64" ]]; then
sudo pwsh -command "& {Install-Module $module -Force -Scope AllUsers}" sudo pwsh -command "& {Install-Module $module -Force -Scope AllUsers}"

View File

@@ -6,23 +6,22 @@
source ~/utils/utils.sh source ~/utils/utils.sh
function InstallPyPy InstallPyPy() {
{ local package_url=$1
PACKAGE_URL=$1
PACKAGE_TAR_NAME=$(basename "$PACKAGE_URL") PACKAGE_TAR_NAME=$(basename $package_url)
echo "Downloading tar archive '$PACKAGE_TAR_NAME'" echo "Downloading tar archive '$PACKAGE_TAR_NAME'"
archive_path=$(download_with_retry "$PACKAGE_URL") archive_path=$(download_with_retry $package_url)
echo "Expand '$PACKAGE_TAR_NAME' to the /tmp folder" echo "Expand '$PACKAGE_TAR_NAME' to the /tmp folder"
tar xf "$archive_path" -C /tmp tar xf $archive_path -C /tmp
# Get Python version # Get Python version
PACKAGE_NAME=${PACKAGE_TAR_NAME/.tar.bz2/} PACKAGE_NAME=${PACKAGE_TAR_NAME/.tar.bz2/}
MAJOR_VERSION=$(echo ${PACKAGE_NAME/pypy/} | cut -d. -f1) MAJOR_VERSION=$(echo ${PACKAGE_NAME/pypy/} | cut -d. -f1)
PYTHON_MAJOR="python$MAJOR_VERSION" PYTHON_MAJOR="python$MAJOR_VERSION"
if [ $MAJOR_VERSION != 2 ]; then if [[ $MAJOR_VERSION != 2 ]]; then
PYPY_MAJOR="pypy$MAJOR_VERSION" PYPY_MAJOR="pypy$MAJOR_VERSION"
else else
PYPY_MAJOR="pypy" PYPY_MAJOR="pypy"
@@ -40,14 +39,14 @@ function InstallPyPy
PYPY_TOOLCACHE_VERSION_ARCH_PATH=$PYPY_TOOLCACHE_VERSION_PATH/x64 PYPY_TOOLCACHE_VERSION_ARCH_PATH=$PYPY_TOOLCACHE_VERSION_PATH/x64
echo "Check if PyPy hostedtoolcache folder exist..." echo "Check if PyPy hostedtoolcache folder exist..."
if [ ! -d $PYPY_TOOLCACHE_PATH ]; then if [[ ! -d $PYPY_TOOLCACHE_PATH ]]; then
mkdir -p $PYPY_TOOLCACHE_PATH mkdir -p $PYPY_TOOLCACHE_PATH
fi fi
echo "Create PyPy '$PYPY_TOOLCACHE_VERSION_PATH' folder" echo "Create PyPy '$PYPY_TOOLCACHE_VERSION_PATH' folder"
mkdir $PYPY_TOOLCACHE_VERSION_PATH mkdir $PYPY_TOOLCACHE_VERSION_PATH
echo "Move PyPy '$PACKAGE_TEMP_FOLDER' binaries to '$PYPY_TOOLCACHE_VERSION_ARCH_PATH' folder" echo "Move PyPy $PACKAGE_TEMP_FOLDER binaries to $PYPY_TOOLCACHE_VERSION_ARCH_PATH folder"
mv $PACKAGE_TEMP_FOLDER $PYPY_TOOLCACHE_VERSION_ARCH_PATH mv $PACKAGE_TEMP_FOLDER $PYPY_TOOLCACHE_VERSION_ARCH_PATH
echo "Create additional symlinks (Required for UsePythonVersion Azure DevOps task)" echo "Create additional symlinks (Required for UsePythonVersion Azure DevOps task)"
@@ -58,8 +57,8 @@ function InstallPyPy
echo $PYPY_FULL_VERSION > "PYPY_VERSION" echo $PYPY_FULL_VERSION > "PYPY_VERSION"
# Starting from PyPy 7.3.4 these links are already included in the package # Starting from PyPy 7.3.4 these links are already included in the package
[ -f ./$PYTHON_MAJOR ] || ln -s $PYPY_MAJOR $PYTHON_MAJOR [[ -f ./$PYTHON_MAJOR ]] || ln -s $PYPY_MAJOR $PYTHON_MAJOR
[ -f ./python ] || ln -s $PYTHON_MAJOR python [[ -f ./python ]] || ln -s $PYTHON_MAJOR python
chmod +x ./python ./$PYTHON_MAJOR chmod +x ./python ./$PYTHON_MAJOR
@@ -76,12 +75,12 @@ versions_json_path=$(download_with_retry "https://downloads.python.org/pypy/vers
toolsetVersions=$(get_toolset_value '.toolcache[] | select(.name | contains("PyPy")) | .arch.'$arch'.versions[]') toolsetVersions=$(get_toolset_value '.toolcache[] | select(.name | contains("PyPy")) | .arch.'$arch'.versions[]')
for toolsetVersion in $toolsetVersions; do for toolsetVersion in $toolsetVersions; do
latestMajorPyPyVersion=$(cat "$versions_json_path" | latestMajorPyPyVersion=$(cat $versions_json_path |
jq -r --arg toolsetVersion $toolsetVersion '.[] jq -r --arg toolsetVersion $toolsetVersion '.[]
| select((.python_version | startswith($toolsetVersion)) and .stable == true).files[] | select((.python_version | startswith($toolsetVersion)) and .stable == true).files[]
| select(.platform == "darwin").download_url' | head -1) | select(.platform == "darwin").download_url' | head -1)
if [[ -z "$latestMajorPyPyVersion" ]]; then if [[ -z $latestMajorPyPyVersion ]]; then
echo "Failed to get PyPy version '$toolsetVersion'" echo "Failed to get PyPy version $toolsetVersion"
exit 1 exit 1
fi fi
InstallPyPy $latestMajorPyPyVersion InstallPyPy $latestMajorPyPyVersion

View File

@@ -12,19 +12,19 @@ if is_Monterey || is_BigSur; then
echo "Install latest Python 2" echo "Install latest Python 2"
python2_pkg=$(download_with_retry "https://www.python.org/ftp/python/2.7.18/python-2.7.18-macosx10.9.pkg") python2_pkg=$(download_with_retry "https://www.python.org/ftp/python/2.7.18/python-2.7.18-macosx10.9.pkg")
python2_pkg_sha256="c570f38b05dd8b112ad21b418cdf51a9816d62f9f44746452739d421be24d50c" python2_pkg_sha256="c570f38b05dd8b112ad21b418cdf51a9816d62f9f44746452739d421be24d50c"
use_checksum_comparison "$python2_pkg" "$python2_pkg_sha256" use_checksum_comparison $python2_pkg $python2_pkg_sha256
choice_changes_xml=$(mktemp /tmp/python2_choice_changes.xml.XXXXXX) choice_changes_xml=$(mktemp /tmp/python2_choice_changes.xml.XXXXXX)
sudo installer -showChoiceChangesXML -pkg "$python2_pkg" -target / | tee "$choice_changes_xml" > /dev/null sudo installer -showChoiceChangesXML -pkg $python2_pkg -target / | tee $choice_changes_xml > /dev/null
# To avoid symlink conflicts, remove tools installation in /usr/local/bin using installer choices # To avoid symlink conflicts, remove tools installation in /usr/local/bin using installer choices
xmllint --shell "$choice_changes_xml" <<EOF xmllint --shell $choice_changes_xml <<EOF
cd //array/dict[string[text()='org.python.Python.PythonUnixTools-2.7']]/integer cd //array/dict[string[text()='org.python.Python.PythonUnixTools-2.7']]/integer
set 0 set 0
save save
EOF EOF
sudo installer -applyChoiceChangesXML "$choice_changes_xml" -pkg "$python2_pkg" -target / sudo installer -applyChoiceChangesXML $choice_changes_xml -pkg $python2_pkg -target /
pip install --upgrade pip pip install --upgrade pip
@@ -46,8 +46,8 @@ export PIPX_HOME=/usr/local/opt/pipx
brew_smart_install "pipx" brew_smart_install "pipx"
echo "export PIPX_BIN_DIR=${PIPX_BIN_DIR}" >> "${HOME}/.bashrc" echo "export PIPX_BIN_DIR=${PIPX_BIN_DIR}" >> ${HOME}/.bashrc
echo "export PIPX_HOME=${PIPX_HOME}" >> "${HOME}/.bashrc" echo "export PIPX_HOME=${PIPX_HOME}" >> ${HOME}/.bashrc
echo 'export PATH="$PIPX_BIN_DIR:$PATH"' >> "${HOME}/.bashrc" echo 'export PATH="$PIPX_BIN_DIR:$PATH"' >> ${HOME}/.bashrc
invoke_tests "Python" invoke_tests "Python"

View File

@@ -4,5 +4,5 @@
## Desc: Install Rosetta ## Desc: Install Rosetta
################################################################################ ################################################################################
echo 'Installing Rosetta' echo "Installing Rosetta"
/usr/sbin/softwareupdate --install-rosetta --agree-to-license /usr/sbin/softwareupdate --install-rosetta --agree-to-license

View File

@@ -8,7 +8,7 @@ source ~/utils/utils.sh
arch=$(get_arch) arch=$(get_arch)
DEFAULT_RUBY_VERSION=$(get_toolset_value '.ruby.default') DEFAULT_RUBY_VERSION=$(get_toolset_value '.ruby.default')
echo Installing Ruby... echo "Installing Ruby..."
brew_smart_install "ruby@${DEFAULT_RUBY_VERSION}" brew_smart_install "ruby@${DEFAULT_RUBY_VERSION}"
if [[ $arch == "arm64" ]]; then if [[ $arch == "arm64" ]]; then
export PATH=/opt/homebrew/opt/ruby@${DEFAULT_RUBY_VERSION}/bin:$PATH export PATH=/opt/homebrew/opt/ruby@${DEFAULT_RUBY_VERSION}/bin:$PATH
@@ -16,12 +16,12 @@ else
export PATH=/usr/local/opt/ruby@${DEFAULT_RUBY_VERSION}/bin:$PATH export PATH=/usr/local/opt/ruby@${DEFAULT_RUBY_VERSION}/bin:$PATH
fi fi
GEM_PATH=`gem env|awk '/EXECUTABLE DIRECTORY/ {print $4}'` GEM_PATH=$(gem env|awk '/EXECUTABLE DIRECTORY/ {print $4}')
echo "GEM_PATH=$GEM_PATH" >> "$HOME/.bashrc" echo "GEM_PATH=$GEM_PATH" >> $HOME/.bashrc
if [[ $arch == "arm64" ]]; then if [[ $arch == "arm64" ]]; then
echo 'export PATH="$GEM_PATH:/opt/homebrew/opt/ruby@'${DEFAULT_RUBY_VERSION}'/bin:$PATH"' >> "$HOME/.bashrc" echo 'export PATH="$GEM_PATH:/opt/homebrew/opt/ruby@'${DEFAULT_RUBY_VERSION}'/bin:$PATH"' >> $HOME/.bashrc
else else
echo 'export PATH="$GEM_PATH:/usr/local/opt/ruby@'${DEFAULT_RUBY_VERSION}'/bin:$PATH"' >> "$HOME/.bashrc" echo 'export PATH="$GEM_PATH:/usr/local/opt/ruby@'${DEFAULT_RUBY_VERSION}'/bin:$PATH"' >> $HOME/.bashrc
fi fi
if ! is_Arm64; then if ! is_Arm64; then
@@ -29,13 +29,13 @@ if ! is_Arm64; then
[ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}") [ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}")
PACKAGE_TAR_NAMES=$(curl "${authString[@]}" -fsSL "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name') PACKAGE_TAR_NAMES=$(curl "${authString[@]}" -fsSL "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name')
TOOLSET_VERSIONS=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .arch.'$arch'.versions[]') TOOLSET_VERSIONS=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .arch.'$arch'.versions[]')
RUBY_PATH="$AGENT_TOOLSDIRECTORY/Ruby" RUBY_PATH=$AGENT_TOOLSDIRECTORY/Ruby
echo "Check if Ruby hostedtoolcache folder exists..." echo "Check if Ruby hostedtoolcache folder exists..."
if [ ! -d $RUBY_PATH ]; then if [[ ! -d $RUBY_PATH ]]; then
mkdir -p $RUBY_PATH mkdir -p $RUBY_PATH
fi fi
echo "ruby path - $RUBY_PATH "
for TOOLSET_VERSION in ${TOOLSET_VERSIONS[@]}; do for TOOLSET_VERSION in ${TOOLSET_VERSIONS[@]}; do
PACKAGE_TAR_NAME=$(echo "$PACKAGE_TAR_NAMES" | grep "^ruby-${TOOLSET_VERSION}-macos-latest.tar.gz$" | egrep -v "rc|preview" | sort -V | tail -1) PACKAGE_TAR_NAME=$(echo "$PACKAGE_TAR_NAMES" | grep "^ruby-${TOOLSET_VERSION}-macos-latest.tar.gz$" | egrep -v "rc|preview" | sort -V | tail -1)
RUBY_VERSION=$(echo "$PACKAGE_TAR_NAME" | cut -d'-' -f 2) RUBY_VERSION=$(echo "$PACKAGE_TAR_NAME" | cut -d'-' -f 2)
@@ -47,10 +47,10 @@ if ! is_Arm64; then
echo "Downloading tar archive $PACKAGE_TAR_NAME" echo "Downloading tar archive $PACKAGE_TAR_NAME"
ARCHIVE_PATH=$(download_with_retry "https://github.com/ruby/ruby-builder/releases/download/toolcache/${PACKAGE_TAR_NAME}") ARCHIVE_PATH=$(download_with_retry "https://github.com/ruby/ruby-builder/releases/download/toolcache/${PACKAGE_TAR_NAME}")
echo "Expand '$PACKAGE_TAR_NAME' to the '$RUBY_VERSION_PATH' folder" echo "Expand $PACKAGE_TAR_NAME to the $RUBY_VERSION_PATH folder"
tar xf "$ARCHIVE_PATH" -C $RUBY_VERSION_PATH tar xf $ARCHIVE_PATH -C $RUBY_VERSION_PATH
COMPLETE_FILE_PATH="$RUBY_VERSION_PATH/x64.complete" COMPLETE_FILE_PATH=$RUBY_VERSION_PATH/x64.complete
if [ ! -f $COMPLETE_FILE_PATH ]; then if [[ ! -f $COMPLETE_FILE_PATH ]]; then
echo "Create complete file" echo "Create complete file"
touch $COMPLETE_FILE_PATH touch $COMPLETE_FILE_PATH
fi fi

View File

@@ -6,14 +6,14 @@
source ~/utils/utils.sh source ~/utils/utils.sh
echo Updating RubyGems... echo "Updating RubyGems..."
gem update --system gem update --system
# Temporarily install activesupport 7.0.8 due to compatibility issues with cocoapods https://github.com/CocoaPods/CocoaPods/issues/12081 # Temporarily install activesupport 7.0.8 due to compatibility issues with cocoapods https://github.com/CocoaPods/CocoaPods/issues/12081
gem install activesupport -v 7.0.8 gem install activesupport -v 7.0.8
gemsToInstall=$(get_toolset_value '.ruby.rubygems | .[]') gemsToInstall=$(get_toolset_value '.ruby.rubygems | .[]')
if [ -n "$gemsToInstall" ]; then if [[ -n $gemsToInstall ]]; then
for gem in $gemsToInstall; do for gem in $gemsToInstall; do
echo "Installing gem $gem" echo "Installing gem $gem"
gem install $gem gem install $gem

View File

@@ -6,23 +6,23 @@
source ~/utils/utils.sh source ~/utils/utils.sh
echo Installing Rustup... echo "Installing Rustup..."
brew_smart_install "rustup-init" brew_smart_install "rustup-init"
echo Installing Rust language... echo "Installing Rust language..."
rustup-init -y --no-modify-path --default-toolchain=stable --profile=minimal rustup-init -y --no-modify-path --default-toolchain=stable --profile=minimal
echo Initialize environment variables... echo "Initialize environment variables..."
CARGO_HOME=$HOME/.cargo CARGO_HOME=$HOME/.cargo
echo Install common tools... echo "Install common tools..."
rustup component add rustfmt clippy rustup component add rustfmt clippy
if is_BigSur || is_Monterey; then if is_BigSur || is_Monterey; then
cargo install --locked bindgen-cli cbindgen cargo-audit cargo-outdated cargo install --locked bindgen-cli cbindgen cargo-audit cargo-outdated
fi fi
echo Cleanup Cargo registry cached data... echo "Cleanup Cargo registry cached data..."
rm -rf $CARGO_HOME/registry/* rm -rf $CARGO_HOME/registry/*
invoke_tests "Rust" invoke_tests "Rust"

View File

@@ -6,13 +6,13 @@
source ~/utils/utils.sh source ~/utils/utils.sh
echo Installing Swiftlint... echo "Installing Swiftlint..."
if is_BigSur; then if is_BigSur; then
# SwiftLint now requires Swift 5.6 or higher to build, and macOS 12 or higher to run https://github.com/realm/SwiftLint/releases/tag/0.49.0 # SwiftLint now requires Swift 5.6 or higher to build, and macOS 12 or higher to run https://github.com/realm/SwiftLint/releases/tag/0.49.0
COMMIT=d1d5743344227fe6e3c37cfba19f0cfe15a9448a COMMIT=d1d5743344227fe6e3c37cfba19f0cfe15a9448a
FORMULA_URL="https://raw.githubusercontent.com/Homebrew/homebrew-core/$COMMIT/Formula/swiftlint.rb" FORMULA_URL="https://raw.githubusercontent.com/Homebrew/homebrew-core/$COMMIT/Formula/swiftlint.rb"
curl -fsSL "$FORMULA_URL" > $(find $(brew --repository) -name swiftlint.rb) curl -fsSL $FORMULA_URL > $(find $(brew --repository) -name swiftlint.rb)
HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_FROM_API=1 brew install swiftlint HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_FROM_API=1 brew install swiftlint
else else
brew_smart_install "swiftlint" brew_smart_install "swiftlint"

View File

@@ -24,13 +24,13 @@ install_vsmac() {
TMPMOUNT=$(/usr/bin/mktemp -d /tmp/visualstudio.XXXX) TMPMOUNT=$(/usr/bin/mktemp -d /tmp/visualstudio.XXXX)
mkdir -p "$TMPMOUNT/downloads" mkdir -p "$TMPMOUNT/downloads"
vsmac_installer=$(download_with_retry "$vsmac_download_url" "$TMPMOUNT/downloads/${vsmac_download_url##*/}") vsmac_installer=$(download_with_retry $vsmac_download_url "$TMPMOUNT/downloads/${vsmac_download_url##*/}")
echo "Mounting Visual Studio..." echo "Mounting Visual Studio..."
hdiutil attach "$vsmac_installer" -mountpoint "$TMPMOUNT" hdiutil attach $vsmac_installer -mountpoint $TMPMOUNT
echo "Moving Visual Studio to /Applications/..." echo "Moving Visual Studio to /Applications/..."
pushd "$TMPMOUNT" pushd $TMPMOUNT
tar cf - "./Visual Studio.app" | tar xf - -C /Applications/ tar cf - "./Visual Studio.app" | tar xf - -C /Applications/
if [[ $vsmac_version != $vsmac_default ]]; then if [[ $vsmac_version != $vsmac_default ]]; then
@@ -38,14 +38,14 @@ install_vsmac() {
fi fi
popd popd
sudo hdiutil detach "$TMPMOUNT" sudo hdiutil detach $TMPMOUNT
sudo rm -rf "$TMPMOUNT" sudo rm -rf $TMPMOUNT
} }
vsmac_versions=($(get_toolset_value '.xamarin.vsmac.versions[]')) vsmac_versions=($(get_toolset_value '.xamarin.vsmac.versions[]'))
default_vsmac_version=$(get_toolset_value '.xamarin.vsmac.default') default_vsmac_version=$(get_toolset_value '.xamarin.vsmac.default')
for version in "${vsmac_versions[@]}"; do for version in ${vsmac_versions[@]}; do
install_vsmac $version $default_vsmac_version install_vsmac $version $default_vsmac_version
done done

View File

@@ -15,17 +15,17 @@ latest_sdk_symlink=$(get_toolset_value '.xamarin.bundles[0].symlink')
current_sdk_symlink=$(get_toolset_value '.xamarin."bundle_default"') current_sdk_symlink=$(get_toolset_value '.xamarin."bundle_default"')
default_xcode_version=$(get_toolset_value '.xcode.default') default_xcode_version=$(get_toolset_value '.xcode.default')
if [ "$current_sdk_symlink" == "latest" ]; then if [[ $current_sdk_symlink == "latest" ]]; then
current_sdk_symlink=$latest_sdk_symlink current_sdk_symlink=$latest_sdk_symlink
fi fi
MONO_VERSIONS_PATH='/Library/Frameworks/Mono.framework/Versions' MONO_VERSIONS_PATH="/Library/Frameworks/Mono.framework/Versions"
IOS_VERSIONS_PATH='/Library/Frameworks/Xamarin.iOS.framework/Versions' IOS_VERSIONS_PATH="/Library/Frameworks/Xamarin.iOS.framework/Versions"
ANDROID_VERSIONS_PATH='/Library/Frameworks/Xamarin.Android.framework/Versions' ANDROID_VERSIONS_PATH="/Library/Frameworks/Xamarin.Android.framework/Versions"
MAC_VERSIONS_PATH='/Library/Frameworks/Xamarin.Mac.framework/Versions' MAC_VERSIONS_PATH="/Library/Frameworks/Xamarin.Mac.framework/Versions"
TMPMOUNT=`/usr/bin/mktemp -d /tmp/visualstudio.XXXX` TMPMOUNT=$(/usr/bin/mktemp -d /tmp/visualstudio.XXXX)
TMPMOUNT_FRAMEWORKS="$TMPMOUNT/frameworks" TMPMOUNT_FRAMEWORKS=$TMPMOUNT/frameworks
createBackupFolders createBackupFolders
pushd $TMPMOUNT pushd $TMPMOUNT
@@ -34,19 +34,19 @@ pushd $TMPMOUNT
downloadNUnitConsole downloadNUnitConsole
# Install Mono sdks # Install Mono sdks
for version in "${mono_versions[@]}"; do installMono $version; done for version in ${mono_versions[@]}; do installMono $version; done
sudo mv -v $TMPMOUNT_FRAMEWORKS/mono/* $MONO_VERSIONS_PATH/ sudo mv -v $TMPMOUNT_FRAMEWORKS/mono/* $MONO_VERSIONS_PATH/
# Install Xamarin.iOS sdks # Install Xamarin.iOS sdks
for version in "${xamarin_ios_versions[@]}"; do installXamarinIOS $version; done for version in ${xamarin_ios_versions[@]}; do installXamarinIOS $version; done
sudo mv -v $TMPMOUNT_FRAMEWORKS/ios/* $IOS_VERSIONS_PATH/ sudo mv -v $TMPMOUNT_FRAMEWORKS/ios/* $IOS_VERSIONS_PATH/
# Install Xamarin.Mac sdks # Install Xamarin.Mac sdks
for version in "${xamarin_mac_versions[@]}"; do installXamarinMac $version; done for version in ${xamarin_mac_versions[@]}; do installXamarinMac $version; done
sudo mv -v $TMPMOUNT_FRAMEWORKS/mac/* $MAC_VERSIONS_PATH/ sudo mv -v $TMPMOUNT_FRAMEWORKS/mac/* $MAC_VERSIONS_PATH/
# Install Xamarin.Android sdks # Install Xamarin.Android sdks
for version in "${xamarin_android_versions[@]}"; do installXamarinAndroid $version; done for version in ${xamarin_android_versions[@]}; do installXamarinAndroid $version; done
sudo mv -v $TMPMOUNT_FRAMEWORKS/android/* $ANDROID_VERSIONS_PATH/ sudo mv -v $TMPMOUNT_FRAMEWORKS/android/* $ANDROID_VERSIONS_PATH/
@@ -75,7 +75,7 @@ createUWPShim
popd popd
echo "Clean up packages..." echo "Clean up packages..."
sudo rm -rf "$TMPMOUNT" sudo rm -rf $TMPMOUNT
# Fix Xamarin issue with Xcode symlink: https://github.com/xamarin/xamarin-macios/issues/9960 # Fix Xamarin issue with Xcode symlink: https://github.com/xamarin/xamarin-macios/issues/9960
PREFERENCES_XAMARIN_DIR="${HOME}/Library/Preferences/Xamarin" PREFERENCES_XAMARIN_DIR="${HOME}/Library/Preferences/Xamarin"

View File

@@ -7,8 +7,8 @@
source ~/utils/utils.sh source ~/utils/utils.sh
is_clt_installed() { is_clt_installed() {
clt_path=`xcode-select -p 2>&1` clt_path=$(xcode-select -p 2>&1)
[[ -d "$clt_path" ]] [[ -d $clt_path ]]
} }
install_clt() { install_clt() {

View File

@@ -1,29 +0,0 @@
#!/bin/bash -e -o pipefail
################################################################################
## File: install-xcode-simulators.sh
## Desc: Install Xcode simulators
################################################################################
source ~/utils/utils.sh
# Downloading and installing simulators
SIMS_TO_INSTALL=(
"8.4"
"9.0"
"9.1"
"9.2"
"9.3"
"10.0"
"10.1"
"10.2"
"10.3"
)
for sim_version in ${SIMS_TO_INSTALL[@]}
do
echo "Installing iOS $sim_version ..."
sudo xcversion simulators --install="iOS ${sim_version}"
echo "Successfuly installed iOS $sim_version ..."
done
echo "Done installing simulator runtimes."

View File

@@ -87,12 +87,6 @@ get_toolset_value() {
echo "$(jq -r "$query" $toolset_path)" echo "$(jq -r "$query" $toolset_path)"
} }
verlte() {
sortedVersion=$(echo -e "$1\n$2" | sort -V | head -n1)
[ "$1" = "$sortedVersion" ]
}
# brew provides package bottles for different macOS versions # brew provides package bottles for different macOS versions
# The 'brew install' command will fail if a package bottle does not exist # The 'brew install' command will fail if a package bottle does not exist
# Use the '--build-from-source' option to build from source in this case # Use the '--build-from-source' option to build from source in this case

View File

@@ -160,7 +160,7 @@ installNunitConsole() {
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
exec /Library/Frameworks/Mono.framework/Versions/${MONO_VERSION}/bin/mono --debug \$MONO_OPTIONS $NUNIT3_PATH/nunit3-console.exe "\$@" exec /Library/Frameworks/Mono.framework/Versions/${MONO_VERSION}/bin/mono --debug \$MONO_OPTIONS $NUNIT3_PATH/nunit3-console.exe "\$@"
EOF EOF
sudo chmod +x "$TMP_WRAPPER_PATH" sudo chmod +x $TMP_WRAPPER_PATH
sudo mv "$TMP_WRAPPER_PATH" "${MONO_VERSIONS_PATH}/${MONO_VERSION}/Commands/nunit3-console" sudo mv "$TMP_WRAPPER_PATH" "${MONO_VERSIONS_PATH}/${MONO_VERSION}/Commands/nunit3-console"
} }