[graalvm] Add automation

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).
This commit is contained in:
Marc Wrobel
2023-08-05 12:19:51 +02:00
parent 2937a343bd
commit 3c3ec29342

32
src/graalvm.py Normal file
View File

@@ -0,0 +1,32 @@
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::")