Merge pull request #161752 from samford/zulu-update-version-format-livecheck

zulu: update version format, livecheck
This commit is contained in:
Patrick Linnane
2023-12-05 10:10:50 -08:00
committed by GitHub
+11 -9
View File
@@ -1,24 +1,26 @@
cask "zulu" do
arch arm: "aarch64", intel: "x64"
choice = on_arch_conditional arm: "arm", intel: "x86"
version "21.0.1,21.30.15-ca"
version "21.0.1,21.30.15"
sha256 arm: "92d65ed61bf6c0bea0f9c44a6dd538da8a6c620a78f517c194913d1338fc39e7",
intel: "f8f46bb00cfb8cecddcf71e10c77a577c9e9843a1e13a35ff05dbeec6f29788f"
url "https://cdn.azul.com/zulu/bin/zulu#{version.csv.second}-jdk#{version.csv.first}-macosx_#{arch}.dmg",
referer: "https://www.azul.com/downloads/zulu/zulu-mac/"
url "https://cdn.azul.com/zulu/bin/zulu#{version.csv.second}-ca-jdk#{version.csv.first}-macosx_#{arch}.dmg",
referer: "https://www.azul.com/downloads/"
name "Azul Zulu Java Standard Edition Development Kit"
desc "OpenJDK distribution from Azul"
homepage "https://www.azul.com/downloads/"
livecheck do
url "https://api.azul.com/zulu/download/community/v1.0/bundles/latest/?jdk_version=#{version.major}&bundle_type=jdk&javafx=false&ext=dmg&os=macos&arch=#{choice}"
strategy :page_match do |page|
match = page.match(/zulu(\d+(?:[._]\d+)*-.*?)-jdk(\d+(?:\.\d+)*)-macosx_#{arch}\.dmg/i)
next if match.blank?
url "https://api.azul.com/metadata/v1/zulu/packages?os=macos&arch=#{arch}&archive_type=dmg&java_package_type=jdk&javafx_bundled=false&latest=true&release_status=ga&availability_types=ca"
regex(/zulu(\d+(?:[._]\d+)*)-ca-jdk(\d+(?:\.\d+)*)-macosx_#{arch}\.dmg/i)
strategy :json do |json, regex|
json.map do |item|
match = item["download_url"]&.match(regex)
next if match.blank?
"#{match[2]},#{match[1]}"
"#{match[2]},#{match[1]}"
end
end
end