[rockylinux] Add release automation

Closes #109.

The diff is fairly normal, with a slight
shift of dates, which is acceptable.

```diff
-json["8.5"] = "2021-11-16";
-json["8.6"] = "2022-05-17";
-json["8.7"] = "2022-11-16";
+json["8.5"] = "2021-11-15";
+json["8.6"] = "2022-05-15";
+json["8.7"] = "2022-11-11";
+json["8.8"] = "2023-05-20";
-json["9.1"] = "2022-11-28";
+json["9.1"] = "2022-11-26";
```
This commit is contained in:
Nemo
2023-08-11 16:54:41 +05:30
committed by Marc Wrobel
parent e564edcc96
commit 56a09215fc

33
src/rockylinux.py Normal file
View File

@@ -0,0 +1,33 @@
import re
from common import endoflife
from datetime import datetime
URL = "https://raw.githubusercontent.com/rocky-linux/wiki.rockylinux.org/development/docs/include/releng/version_table.md"
REGEX = r"^(\d+\.\d+)$"
def parse_date(date_str):
date_str = date_str.replace(',', '').strip()
date_obj = datetime.strptime(date_str, "%B %d %Y")
return date_obj.strftime("%Y-%m-%d")
def parse_markdown_table(table_text):
lines = table_text.strip().split('\n')
versions = {}
for line in lines:
items = line.split('|')
if len(items) >=5 and re.match(REGEX, items[1].strip()):
version = items[1].strip()
date = parse_date(items[3])
print(f"{version}: {date}")
versions[version] = date
return versions
print("::group::rockylinux")
response = endoflife.fetch_url(URL)
versions = parse_markdown_table(response)
endoflife.write_releases('rockylinux', versions)
print("::endgroup::")