From 2959f467cefba1f0bc26da2e9cecdc9255678d6b Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Sun, 28 Aug 2022 18:11:59 +0300 Subject: [PATCH] Install the latest swiftlint only for macOS 12 (#6151) --- images/macos/provision/core/swiftlint.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/images/macos/provision/core/swiftlint.sh b/images/macos/provision/core/swiftlint.sh index b4cea685..47259f3c 100644 --- a/images/macos/provision/core/swiftlint.sh +++ b/images/macos/provision/core/swiftlint.sh @@ -2,7 +2,14 @@ source ~/utils/utils.sh echo "Install SwiftLint" -swiftlintUrl=$(get_github_package_download_url "realm/SwiftLint" "contains(\"portable_swiftlint.zip\")" "latest" "$API_PAT") +# 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 +if is_Less_Monterey; then + version="0.48.0" +else + version="latest" +fi + +swiftlintUrl=$(get_github_package_download_url "realm/SwiftLint" "contains(\"portable_swiftlint.zip\")" "$version" "$API_PAT") download_with_retries $swiftlintUrl "/tmp" "portable_swiftlint.zip" unzip -q "/tmp/portable_swiftlint.zip" -d /usr/local/bin # Remove the LICENSE file that comes along with the binary and the downloaded archive