Skip to content

Update Oracle livechecks #220406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions Casks/g/graalvm-jdk.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cask "graalvm-jdk" do
arch arm: "aarch64", intel: "x64"

version "24.0.1,9"
sha256 arm: "875555f6063b4847b617504e8f8a36290a6726770be72388261f6118bcf28f81",
intel: "35852ef7040be5e73d4b8f23481c4f70e4dcb088d302e28f6a88e6a4d47de2b9"
version "24.0.2,12"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The folder within the archive is graalvm-jdk-24.0.2+11.1.

Copy link
Contributor Author

@MTCoster MTCoster Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's interesting, so they've updated it since CI caught that before but still not to the correct version.

graalvm-jdk runs are failing because the tarball contains a directory with the version 24.0.2+11 instead of 24.0.2+12

The current livecheck is broken so I don't know what it would be returning, but the version implemented here returns +12.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we drop this file and open a new PR to work on it? Then we can merge the other livecheck updates.

sha256 arm: "2dc7634ed939c725d41a353f73443ff32e70f2fb577367f12a6936107e3494dc",
intel: "df0f9e5d101201c50bfa6baa3c657a81a2883c5b5097a9f5ab93dab86f7e3ba2"

url "https://download.oracle.com/graalvm/#{version.major}/archive/graalvm-jdk-#{version.csv.first}_macos-#{arch}_bin.tar.gz",
verified: "download.oracle.com/"
Expand All @@ -12,20 +12,15 @@
homepage "https://www.graalvm.org/"

livecheck do
url "https://www.oracle.com/java/technologies/downloads/"
regex(%r{/otn_software/java/jdk/(\d+(?:\.\d+)*)\+(\d+)/}i)
strategy :page_match do |page, regex|
major = page.scan(%r{href=.*?/technologies/javase-jdk(\d+)-doc-downloads\.html}i)
.max_by { |match| Version.new(match[0]) }
&.first
next if major.blank?

download_page = Homebrew::Livecheck::Strategy.page_content(
"https://www.oracle.com/java/technologies/javase-jdk#{major}-doc-downloads.html",
)
next if (download_page_content = download_page[:content]).blank?

download_page_content.scan(regex).map { |match| "#{match[0]},#{match[1]}" }
url "https://java.oraclecloud.com/currentJavaReleases"
regex(/(?:jdk[._-])?(\d+(?:\.\d+)*)(?:-\d+)?\+(\d+)/i)
strategy :json do |json, regex|
json["items"]&.map do |item|
match = item["releaseFullVersion"]&.match(regex)
next if match.blank?

"#{match[1]},#{match[2]}"
end
end
end

Expand Down
11 changes: 7 additions & 4 deletions Casks/g/graalvm-jdk@21.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
homepage "https://www.graalvm.org/"

livecheck do
url "https://docs.oracle.com/en/graalvm/jdk/21/docs/release-notes/"
regex(/<strong>v?(\d+(?:\.\d+)+)\+(\d+)[ "<]/i)
strategy :page_match do |page, regex|
page.scan(regex).map { |match| "#{match[0]},#{match[1]}" }
url "https://java.oraclecloud.com/currentJavaReleases/#{version.major}"
regex(/(?:jdk[._-])?(\d+(?:\.\d+)*)(?:-\d+)?\+(\d+)/i)
strategy :json do |json, regex|
match = json["releaseFullVersion"]&.match(regex)
next if match.blank?

"#{match[1]},#{match[2]}"
end
end

Expand Down
17 changes: 3 additions & 14 deletions Casks/o/oracle-jdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,9 @@
homepage "https://www.oracle.com/java/technologies/downloads/"

livecheck do
url :homepage
regex(/<li>\s*JDK\s*v?(\d+(?:\.\d+)*)/i)
strategy :page_match do |page, regex|
major = page.scan(%r{href=.*?/javase/(\d+)u-relnotes\.html}i)
.max_by { |match| Version.new(match[0]) }
&.first
next if major.blank?

release_page = Homebrew::Livecheck::Strategy.page_content(
"https://www.oracle.com/java/technologies/javase/#{major}u-relnotes.html",
)
next if (release_page_content = release_page[:content]).blank?

release_page_content.scan(regex).map { |match| match[0] }
url "https://java.oraclecloud.com/currentJavaReleases"
strategy :json do |json|
json["items"]&.filter_map { |item| item["releaseVersion"] }
end
end

Expand Down
6 changes: 4 additions & 2 deletions Casks/o/oracle-jdk@21.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
homepage "https://www.oracle.com/java/technologies/downloads/"

livecheck do
url "https://www.oracle.com/java/technologies/javase/#{version.major}u-relnotes.html"
regex(/<li>\s*JDK\s*v?(\d+(?:\.\d+)*)/i)
url "https://java.oraclecloud.com/currentJavaReleases/#{version.major}"
strategy :json do |json|
json["releaseVersion"]
end
end

depends_on macos: ">= :mojave"
Expand Down
Loading