Script to fetch unrealircd releases (#4)

unrealircd: 6.0.3
elasticsearch: 8.2.0
laravel: 8.83.11, 9.11.0
This commit is contained in:
Nemo
2022-05-03 21:53:53 +05:30
committed by GitHub
parent 7dd09864e5
commit 8997487f42
7 changed files with 115 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
name: Update Data
on:
push:
schedule:
# Run 4 times a day (every 6 hours)
# At minute 17 past hour 0, 6, 12, and 18
@@ -38,9 +39,11 @@ jobs:
bundler-cache: true
- name: Update Release data
run: |
mkdir -p ~/.cache/{npm,git,oci} releases/{npm,git,oci} && \
mkdir -p ~/.cache/{npm,git,oci} releases/{npm,git,oci,custom} && \
git config --global init.defaultBranch main
git config --global extensions.partialClone true
pip install -r requirements.txt
python src/unrealircd.py
bundle exec ruby update.rb ./website ~/.cache releases
id: update_releases
- uses: stefanzweifel/git-auto-commit-action@v4

View File

@@ -0,0 +1,81 @@
{
"6.0.3": "2022-04-02",
"6.0.2": "2022-01-28",
"6.0.1.1": "2021-12-29",
"6.0.0": "2021-12-17",
"5.2.4": "2022-01-28",
"5.2.3": "2021-12-29",
"5.2.2": "2021-10-03",
"5.2.1.1": "2021-07-10",
"5.2.1": "2021-07-09",
"5.2.0.1": "2021-06-16",
"5.2.0": "2021-06-14",
"5.0.9.1": "2021-03-26",
"5.0.9": "2021-03-20",
"5.0.8": "2021-01-08",
"5.0.7": "2020-10-10",
"5.0.6": "2020-07-16",
"5.0.5.1": "2020-05-29",
"5.0.5": "2020-05-27",
"5.0.4": "2020-04-19",
"5.0.3.1": "2020-02-11",
"5.0.3": "2020-02-08",
"5.0.2": "2020-01-22",
"5.0.1": "2020-01-03",
"5.0.0": "2019-12-13",
"4.2.4.1": "2019-07-07",
"4.2.4": "2019-06-30",
"4.2.3": "2019-04-30",
"4.2.2": "2019-03-01",
"4.2.1.1": "2019-01-03",
"4.2.1": "2018-12-27",
"4.2.0": "2018-09-30",
"4.0.18": "2018-06-23",
"4.0.17": "2017-12-23",
"4.0.16": "2017-11-12",
"4.0.15": "2017-10-01",
"4.0.14": "2017-09-15",
"4.0.13": "2017-08-15",
"4.0.12": "2017-05-12",
"4.0.11": "2017-02-10",
"4.0.10": "2017-01-13",
"4.0.9": "2016-12-03",
"4.0.8": "2016-11-11",
"4.0.7": "2016-10-09",
"4.0.6": "2016-09-03",
"4.0.5": "2016-07-28",
"4.0.4": "2016-06-26",
"4.0.3.1": "2016-04-24",
"4.0.3": "2016-04-16",
"4.0.2": "2016-03-11",
"4.0.1": "2016-01-13",
"4.0.0": "2015-12-24",
"3.2.10.7": "2016-09-03",
"3.2.10.6": "2015-12-11",
"3.2.10.5": "2015-08-16",
"3.2.10.4": "2014-07-26",
"3.2.10.3": "2014-05-31",
"3.2.10.2": "2013-11-23",
"3.2.10.1": "2013-04-05",
"3.2.10": "2012-12-25",
"3.2.9": "2011-11-05",
"3.2.8": "2009-03-01",
"3.2.7": "2007-07-13",
"3.2.6": "2006-12-23",
"3.2.5": "2006-06-17",
"3.2.4": "2006-02-03",
"3.2.3": "2005-03-14",
"3.2.2": "2004-10-27",
"3.2.1": "2004-07-03",
"3.2": "2004-04-25",
"3.1.6": "2003-06-15",
"3.1.5.1": "2003-01-20",
"3.1.4": "2002-08-07",
"3.1.3": "2002-03-24",
"3.1.1": "2000-12-04",
"3.0": "2000-02-27",
"2.1.5": "1999-08-10",
"2.1.3": "1999-08-05",
"2.1.1": "1999-07-21",
"2.1": "1999-07-12"
}

View File

@@ -211,5 +211,6 @@
"8.1.0": "2022-03-03",
"8.1.1": "2022-03-17",
"8.1.2": "2022-03-29",
"8.1.3": "2022-04-15"
"8.1.3": "2022-04-15",
"8.2.0": "2022-04-20"
}

View File

@@ -754,6 +754,7 @@
"8.83.0": "2022-02-08",
"8.83.1": "2022-02-15",
"8.83.10": "2022-04-27",
"8.83.11": "2022-05-03",
"8.83.2": "2022-02-22",
"8.83.3": "2022-03-03",
"8.83.4": "2022-03-08",
@@ -769,6 +770,7 @@
"9.1.0": "2022-02-15",
"9.10.0": "2022-04-27",
"9.10.1": "2022-04-28",
"9.11.0": "2022-05-03",
"9.2.0": "2022-02-22",
"9.3.0": "2022-03-02",
"9.3.1": "2022-03-03",

1
requirements.txt Normal file
View File

@@ -0,0 +1 @@
mwparserfromhell==0.6.4

24
src/unrealircd.py Normal file
View File

@@ -0,0 +1,24 @@
import mwparserfromhell
import json
import re
import urllib.request
URL = "https://www.unrealircd.org/docwiki/index.php?title=History_of_UnrealIRCd_releases&action=raw"
REGEX = r'^(?:(\d+\.(?:\d+\.)*\d+))$'
list = {}
with urllib.request.urlopen(URL) as response:
text = response.read()
wikicode = mwparserfromhell.parse(text)
for tr in wikicode.ifilter_tags(matches=lambda node: node.tag == "tr"):
items = tr.contents.filter_tags(matches=lambda node: node.tag == "td")
if len(items) >=2:
maybe_version = items[0].__strip__()
if re.match(REGEX, maybe_version):
maybe_date = items[1].__strip__()
if re.match(r'\d{4}-\d{2}-\d{2}', maybe_date):
list[maybe_version] = maybe_date
with open('releases/custom/unrealircd.json', 'w') as f:
f.write(json.dumps(list, indent=2))

View File

@@ -76,7 +76,7 @@ def generate_commit_message
r = Rugged::Repository.new '.'
r.status() do |f, s|
p = Pathname.new(f).dirname
if p.to_s === 'releases/git'
if p.to_s === 'releases/git' || p.to_s === 'releases/custom'
ret = true
product = File.basename(f, '.json')
products << product