GraalVM for JDK versions has to be prefixed as their release cycle collide with older GraalVM release cycles. Example: GraalVM for JDK 20 and 20.0 (will be the same with JDK 21 and 22).
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
import re
|
|
from bs4 import BeautifulSoup
|
|
from common import endoflife
|
|
from datetime import datetime
|
|
|
|
URL = "https://www.graalvm.org/release-calendar/"
|
|
# https://regex101.com/r/877ibq/1
|
|
regex = r"RHEL (?P<major>\d)(\. ?(?P<minor>\d+))?(( Update (?P<minor2>\d))| GA)?"
|
|
|
|
def parse_date(text):
|
|
return datetime.strptime(text, "%B %d, %Y").strftime("%Y-%m-%d")
|
|
|
|
def split_versions(text):
|
|
# GraalVM for JDK versions has to be prefixed as their release cycle collide
|
|
# with older GraalVM release cycles. Example: GraalVM for JDK 20 and 20.0.
|
|
return text.replace("GraalVM for JDK ", "jdk-").split(", ")
|
|
|
|
print("::group::graalvm")
|
|
response = endoflife.fetch_url(URL)
|
|
soup = BeautifulSoup(response, features="html5lib")
|
|
|
|
versions = {}
|
|
for tr in soup.findAll("table")[1].find("tbody").findAll("tr"):
|
|
td_list = tr.findAll("td")
|
|
date = parse_date(td_list[0].get_text())
|
|
|
|
for version in split_versions(td_list[2].get_text()):
|
|
versions[version] = date
|
|
print(f"{version}: {date}")
|
|
|
|
endoflife.write_releases('graalvm', versions)
|
|
print("::endgroup::")
|