mirror of
https://github.com/actions/runner-images.git
synced 2026-01-07 18:58:13 +08:00
Merge remote-tracking branch 'upstream/main' into macos-retry-downloads
This commit is contained in:
22
images/macos/provision/assets/select-xamarin-sdk.sh
Normal file
22
images/macos/provision/assets/select-xamarin-sdk.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash -e -o pipefail
|
||||
if [ -z "$1" ]; then
|
||||
echo "No Xamarin SDK specified."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
XAMARIN_SDK=$1
|
||||
|
||||
echo "Set Xamarin SDK to ${XAMARIN_SDK}"
|
||||
FOLDERS_LIST=(
|
||||
'/Library/Frameworks/Mono.framework/Versions'
|
||||
'/Library/Frameworks/Xamarin.iOS.framework/Versions'
|
||||
'/Library/Frameworks/Xamarin.Android.framework/Versions'
|
||||
'/Library/Frameworks/Xamarin.Mac.framework/Versions'
|
||||
)
|
||||
|
||||
for FOLDER in "${FOLDERS_LIST[@]}"
|
||||
do
|
||||
echo "Set Current folder for ${FOLDER}"
|
||||
sudo rm -f ${FOLDER}/Current
|
||||
sudo ln -s ${FOLDER}/${XAMARIN_SDK} ${FOLDER}/Current
|
||||
done
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/bash -e -o pipefail
|
||||
BOOTSTRAP_PATH="$1"
|
||||
ProvisionerPackageUri="$2"
|
||||
ProvisionerScriptUri="$3"
|
||||
|
||||
@@ -16,9 +16,24 @@ fi
|
||||
# Put documentation to $HOME root
|
||||
cp $HOME/image-generation/output/software-report/systeminfo.txt $HOME/image-generation/output/software-report/systeminfo.md $HOME/
|
||||
|
||||
# Put build vm assets scripts to proper directory
|
||||
mkdir -p /usr/local/opt/$USER/scripts
|
||||
mv $HOME/image-generation/assets/* /usr/local/opt/$USER/scripts
|
||||
|
||||
find /usr/local/opt/$USER/scripts -type f -name "*\.sh" -exec chmod +x {} \;
|
||||
|
||||
# Clean up npm cache which collected during image-generation
|
||||
# we have to do that here because `npm install` is run in a few different places during image-generation
|
||||
npm cache clean --force
|
||||
|
||||
# Clean yarn cache
|
||||
yarn cache clean
|
||||
|
||||
# Clean up temporary directories
|
||||
rm -rf ~/utils ~/image-generation
|
||||
rm -rf ~/utils ~/image-generation
|
||||
|
||||
# Erase all indexes and wait until the rebuilding process ends,
|
||||
# for now there is no way to get status of indexing process, it takes around 3 minutes to accomplish
|
||||
sudo mdutil -E /
|
||||
sudo log stream | grep -q -E 'mds.*Released.*BackgroundTask' || true
|
||||
echo "Indexing completed"
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash -e -o pipefail
|
||||
source ~/utils/utils.sh
|
||||
|
||||
echo "Installing Chrome..."
|
||||
brew cask install google-chrome
|
||||
brew_cask_install_ignoring_sha256 "google-chrome"
|
||||
|
||||
echo "Installing Chrome Driver"
|
||||
brew cask install chromedriver
|
||||
|
||||
@@ -21,7 +21,6 @@ binst_common_utils=(
|
||||
gh
|
||||
p7zip
|
||||
ant
|
||||
yamllint
|
||||
aria2
|
||||
)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ echo "Version of Microsoft Edge: ${EDGE_VERSION}"
|
||||
|
||||
echo "Installing Microsoft Edge WebDriver..."
|
||||
|
||||
EDGE_DRIVER_VERSION_URL="https://msedgedriver.azureedge.net/LATEST_RELEASE_${EDGE_VERSION_MAJOR}"
|
||||
EDGE_DRIVER_VERSION_URL="https://msedgedriver.azureedge.net/LATEST_RELEASE_${EDGE_VERSION_MAJOR}_MACOS"
|
||||
EDGE_DRIVER_LATEST_VERSION=$(curl -s "$EDGE_DRIVER_VERSION_URL" | iconv -f utf-16 -t utf-8 | tr -d '\r')
|
||||
EDGE_DRIVER_URL="https://msedgedriver.azureedge.net/${EDGE_DRIVER_LATEST_VERSION}/edgedriver_mac64.zip"
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ JAVA_DEFAULT=$(get_toolset_value '.java.default')
|
||||
for JAVA_VERSION in "${JAVA_VERSIONS_LIST[@]}"
|
||||
do
|
||||
if [[ $JAVA_VERSION == "7" ]]; then
|
||||
installAzulJDK "https://cdn.azul.com/zulu/bin/zulu7.40.0.15-ca-jdk7.0.272-macosx_x64.dmg"
|
||||
installAzulJDK "https://cdn.azul.com/zulu/bin/zulu7.42.0.13-ca-jdk7.0.282-macosx_x64.dmg"
|
||||
else
|
||||
brew cask install "adoptopenjdk${JAVA_VERSION}"
|
||||
fi
|
||||
|
||||
19
images/macos/provision/core/pipx-packages.sh
Normal file
19
images/macos/provision/core/pipx-packages.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash -e -o pipefail
|
||||
source ~/utils/utils.sh
|
||||
|
||||
export PATH="$PATH:/opt/pipx_bin"
|
||||
|
||||
toolset=$(get_toolset_path)
|
||||
pipx_packages=$(jq -r ".pipx[] .package" $toolset)
|
||||
|
||||
for package in $pipx_packages; do
|
||||
python_version=$(jq -r ".pipx[] | select(.package == \"$package\") .python" $toolset)
|
||||
if [ "$python_version" != "null" ]; then
|
||||
python_path="$HOME/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version"
|
||||
echo "Install $package into python $python_path"
|
||||
pipx install $package --python $python_path
|
||||
else
|
||||
echo "Install $package into default python"
|
||||
pipx install $package
|
||||
fi
|
||||
done
|
||||
@@ -33,4 +33,7 @@ sudo pwsh -command "& {Import-Module Az; Enable-AzureRmAlias -Scope LocalMachine
|
||||
sudo ln -s /usr/local/bin/pwsh /usr/local/bin/powershell
|
||||
|
||||
# fix ~/.azure directory permissions
|
||||
sudo chown -R ${USER}: $HOME/.azure
|
||||
sudo chown -R ${USER}: $HOME/.azure
|
||||
|
||||
# fix permissions for Az.Account version 2.*
|
||||
sudo chown -R ${USER}: $HOME/.local/share/.IdentityService
|
||||
@@ -10,10 +10,20 @@ brew install python@3.8
|
||||
brew install python@3.9
|
||||
brew unlink python@3.9
|
||||
brew unlink python@3.8
|
||||
brew link python@3.8
|
||||
brew link python@3.8 --force
|
||||
|
||||
echo "Brew Installing Python 2"
|
||||
# Create local tap with formula due to python2 formula depreciation
|
||||
brew tap-new --no-git local/python2
|
||||
FORMULA_PATH=$(brew extract python@2 local/python2 | grep "Homebrew/Library/Taps")
|
||||
brew install $FORMULA_PATH
|
||||
|
||||
echo "Installing pipx"
|
||||
export PIPX_BIN_DIR=/usr/local/opt/pipx_bin
|
||||
export PIPX_HOME=/usr/local/opt/pipx
|
||||
|
||||
brew install pipx
|
||||
|
||||
echo "export PIPX_BIN_DIR=${PIPX_BIN_DIR}" >> "${HOME}/.bashrc"
|
||||
echo "export PIPX_HOME=${PIPX_HOME}" >> "${HOME}/.bashrc"
|
||||
echo 'export PATH="$PIPX_BIN_DIR:$PATH"' >> "${HOME}/.bashrc"
|
||||
|
||||
@@ -107,4 +107,17 @@ get_default_xcode_from_toolset() {
|
||||
verlte() {
|
||||
sortedVersion=$(echo -e "$1\n$2" | sort -V | head -n1)
|
||||
[ "$1" = "$sortedVersion" ]
|
||||
}
|
||||
|
||||
brew_cask_install_ignoring_sha256() {
|
||||
local TOOL_NAME=$1
|
||||
|
||||
CASK_DIR="$(brew --repo homebrew/cask)/Casks"
|
||||
chmod a+w "$CASK_DIR/$TOOL_NAME.rb"
|
||||
SHA=$(grep "sha256" "$CASK_DIR/$TOOL_NAME.rb" | awk '{print $2}')
|
||||
sed -i '' "s/$SHA/:no_check/" "$CASK_DIR/$TOOL_NAME.rb"
|
||||
brew cask install $TOOL_NAME
|
||||
pushd $CASK_DIR
|
||||
git checkout HEAD -- "$TOOL_NAME.rb"
|
||||
popd
|
||||
}
|
||||
@@ -9,6 +9,11 @@ createXamarinProvisionatorSymlink() {
|
||||
FULL_VERSION="12.0.1"
|
||||
fi
|
||||
|
||||
# temporary trick for 12.1.1
|
||||
if [[ $XCODE_VERSION == "12.1" ]]; then
|
||||
FULL_VERSION="12.1.1"
|
||||
fi
|
||||
|
||||
if [ $FULL_VERSION != $XCODE_VERSION ]; then
|
||||
ln -sf "/Applications/Xcode_${XCODE_VERSION}.app" "/Applications/Xcode_${FULL_VERSION}.app"
|
||||
fi
|
||||
@@ -19,6 +24,8 @@ getXcodeVersionToInstall() {
|
||||
|
||||
if [[ $XCODE_VERSION == "12" ]]; then
|
||||
echo "12.0.1"
|
||||
elif [[ $XCODE_VERSION == "12.1" ]]; then
|
||||
echo "12.1.1 Release Candidate"
|
||||
elif [[ ! $XCODE_VERSION =~ "_beta" ]]; then
|
||||
echo "${XCODE_VERSION//_/ }"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user