[macOS] Remove macOS-11 related code due to the deprecation (#10383)

This commit is contained in:
Erik Bershel
2024-08-09 11:25:15 +02:00
committed by GitHub
parent 88cb1bef47
commit 22143c7c68
27 changed files with 74 additions and 1176 deletions

View File

@@ -17,14 +17,7 @@ sudo rm -f /var/vm/sleepimage
defaults write NSGlobalDomain NSAppSleepDisabled -bool YES
# Disable Keyboard Setup Assistant window
if is_Veertu; then
sudo defaults write /Library/Preferences/com.apple.keyboardtype "keyboardtype" -dict-add "3-7582-0" -int 40
fi
# Change screen resolution to the maximum supported for 4Mb video memory
if [[ -d "/Library/Application Support/VMware Tools" ]]; then
sudo "/Library/Application Support/VMware Tools/vmware-resolutionSet" 1176 885
fi
sudo defaults write /Library/Preferences/com.apple.keyboardtype "keyboardtype" -dict-add "3-7582-0" -int 40
# Update VoiceOver Utility to allow VoiceOver to be controlled with AppleScript
# by creating a special Accessibility DB file (SIP must be disabled) and
@@ -39,7 +32,6 @@ defaults write com.apple.VoiceOver4/default SCREnableAppleScript -bool YES
# Rotate the certificate before expiration to ensure your apps are installed and signed with an active certificate.
# Confirm that the correct intermediate certificate is installed by verifying the expiration date is set to 2030.
# sudo security delete-certificate -Z FF6797793A3CD798DC5B2ABEF56F73EDC9F83A64 /Library/Keychains/System.keychain
# Big Sur requires user interaction to add a cert https://developer.apple.com/forums/thread/671582, we need to use a workaround with SecItemAdd swift method
swiftc -suppress-warnings "${HOME}/image-generation/add-certificate.swift"
@@ -58,7 +50,7 @@ done
rm -f ./add-certificate
# enable-automationmode-without-authentication
if ! is_BigSur; then
retry=10
while [[ $retry -gt 0 ]]; do
{
@@ -84,16 +76,15 @@ EOF
sleep 10
done
echo "Getting terminal windows"
term_service=$(launchctl list | grep -i terminal | cut -f3)
echo "Close terminal windows: gui/501/${term_service}"
launchctl bootout gui/501/${term_service} && sleep 5
echo "Getting terminal windows"
term_service=$(launchctl list | grep -i terminal | cut -f3)
echo "Close terminal windows: gui/501/${term_service}"
launchctl bootout gui/501/${term_service} && sleep 5
# test enable-automationmode-without-authentication
if [[ ! "$(automationmodetool)" =~ "DOES NOT REQUIRE" ]]; then
echo "Failed to enable enable-automationmode-without-authentication option"
exit 1
fi
# test enable-automationmode-without-authentication
if [[ ! "$(automationmodetool)" =~ "DOES NOT REQUIRE" ]]; then
echo "Failed to enable enable-automationmode-without-authentication option"
exit 1
fi
# Create symlink for tests running

View File

@@ -19,15 +19,9 @@ if [[ $arch == "arm64" ]]; then
else
image_label="macos-${label_version}"
fi
release_label="macOS-${label_version}"
if is_Ventura || is_Sonoma || is_Monterey; then
software_url="https://github.com/actions/runner-images/blob/${image_label}/${image_version}/images/macos/${image_label}-Readme.md"
releaseUrl="https://github.com/actions/runner-images/releases/tag/${image_label}%2F${image_version}"
else
software_url="https://github.com/actions/runner-images/blob/${release_label}/${image_version}/images/macos/${image_label}-Readme.md"
releaseUrl="https://github.com/actions/runner-images/releases/tag/${release_label}%2F${image_version}"
fi
software_url="https://github.com/actions/runner-images/blob/${image_label}/${image_version}/images/macos/${image_label}-Readme.md"
releaseUrl="https://github.com/actions/runner-images/releases/tag/${image_label}%2F${image_version}"
cat <<EOF > $imagedata_file
[

View File

@@ -10,11 +10,9 @@ echo "Installing aws..."
awscliv2_pkg_path=$(download_with_retry "https://awscli.amazonaws.com/AWSCLIV2.pkg")
sudo installer -pkg "$awscliv2_pkg_path" -target /
if ! is_BigSur; then
echo "Installing aws sam cli..."
brew tap aws/tap
brew_smart_install aws-sam-cli
fi
echo "Installing aws sam cli..."
brew tap aws/tap
brew_smart_install aws-sam-cli
echo "Install aws cli session manager"
brew install --cask session-manager-plugin

View File

@@ -6,12 +6,6 @@
source ~/utils/utils.sh
# Download and install YQ in cases when it is not available in the formulae as for macOS 11: https://formulae.brew.sh/formula/yq
if is_BigSur; then
binary_path=$(download_with_retry "https://github.com/mikefarah/yq/releases/latest/download/yq_darwin_amd64")
sudo install "$binary_path" /usr/local/bin/yq
fi
# Monterey needs future review:
# aliyun-cli, gnupg, helm have issues with building from the source code.
# Added gmp for now, because toolcache ruby needs its libs. Remove it when php starts to build from source code.
@@ -48,27 +42,22 @@ fi
# Execute AppleScript to change security preferences
# System Preferences -> Security & Privacy -> General -> Unlock -> Allow -> Not now
if is_Monterey; then
if is_Veertu; then
for retry in {4..0}; do
echo "Executing AppleScript to change security preferences. Retries left: $retry"
{
set -e
osascript -e 'tell application "System Events" to get application processes where visible is true'
osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD
} && break
for retry in {4..0}; do
echo "Executing AppleScript to change security preferences. Retries left: $retry"
{
set -e
osascript -e 'tell application "System Events" to get application processes where visible is true'
osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD
} && break
if [[ $retry -eq 0 ]]; then
echo "Executing AppleScript failed. No retries left"
exit 1
fi
if [[ $retry -eq 0 ]]; then
echo "Executing AppleScript failed. No retries left"
exit 1
fi
echo "Executing AppleScript failed. Sleeping for 10 seconds and retrying"
sleep 10
done
else
echo "Executing AppleScript to change security preferences"
osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD
fi
echo "Executing AppleScript failed. Sleeping for 10 seconds and retrying"
sleep 10
done
fi
# Validate "Parallels International GmbH" kext
@@ -95,10 +84,8 @@ if is_Monterey; then
echo "export PARALLELS_DMG_URL=$url" >> ${HOME}/.bashrc
fi
if ! is_BigSur; then
# Install Azure DevOps extension for Azure Command Line Interface
az extension add -n azure-devops
fi
# Install Azure DevOps extension for Azure Command Line Interface
az extension add -n azure-devops
# Invoke tests for all basic tools
invoke_tests "BasicTools"

View File

@@ -11,16 +11,13 @@ brew_smart_install "git"
git config --global --add safe.directory "*"
echo "Installing Git LFS"
brew_smart_install "git-lfs"
if ! is_BigSur; then
echo "Installing Git LFS"
brew_smart_install "git-lfs"
# Update global git config
git lfs install
# Update system git config
sudo git lfs install --system
fi
# Update global git config
git lfs install
# Update system git config
sudo git lfs install --system
echo "Disable all the Git help messages..."
git config --global advice.pushUpdateRejected false

View File

@@ -16,7 +16,7 @@ echo Installing yarn...
yarn_installer_path=$(download_with_retry "https://yarnpkg.com/install.sh")
bash $yarn_installer_path
if is_BigSur || is_Monterey; then
if is_Monterey; then
npm_global_packages=$(get_toolset_value '.npm.global_packages[].name')
for module in ${npm_global_packages[@]}; do
echo "Install $module"

View File

@@ -8,7 +8,7 @@ source ~/utils/utils.sh
echo "Installing Python Tooling"
if is_Monterey || is_BigSur; then
if is_Monterey; then
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_sha256="c570f38b05dd8b112ad21b418cdf51a9816d62f9f44746452739d421be24d50c"
@@ -33,9 +33,7 @@ EOF
fi
# Close Finder window
if is_Veertu; then
close_finder_window
fi
close_finder_window
echo "Brew Installing Python 3"
brew_smart_install "python@3.12"

View File

@@ -18,7 +18,7 @@ CARGO_HOME=$HOME/.cargo
echo "Install common tools..."
rustup component add rustfmt clippy
if is_BigSur || is_Monterey; then
if is_Monterey; then
cargo install bindgen-cli cbindgen cargo-audit cargo-outdated
fi

View File

@@ -7,14 +7,7 @@
source ~/utils/utils.sh
echo "Installing Swiftlint..."
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
COMMIT=d1d5743344227fe6e3c37cfba19f0cfe15a9448a
FORMULA_URL="https://raw.githubusercontent.com/Homebrew/homebrew-core/$COMMIT/Formula/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
elif is_Monterey; then
if is_Monterey; then
# SwiftLint now requires Xcode 15.3 or higher to build https://github.com/realm/SwiftLint/releases/tag/0.55.1
COMMIT=d91dabd087cb0b906c92a825df9e5e5e1a4f59f8
FORMULA_URL="https://raw.githubusercontent.com/Homebrew/homebrew-core/$COMMIT/Formula/s/swiftlint.rb"