Skip to content

Commit

Permalink
chore: hoge
Browse files Browse the repository at this point in the history
  • Loading branch information
haruki7049 committed Jul 17, 2024
1 parent 9b6d0ba commit 6d56f23
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion fetch-releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,30 @@ def gen_v3_x64_releases(versions: list, v3_x64_urls: list) -> list:
return result


def gen_releases(versions: list, v3_x64_urls: list, v4_x64_urls: list) -> list:
result: list = []

print("Number of versions: ", len(versions))

for url in v3_x64_urls:
for version in versions:
if is_correct_version_url(version, url):
print("Generating nix hash for: ", url)
sha256 = gen_nix_hash(url)

result.append({ "version": version, "url": url, "sha256": sha256, "arch": "x86_64-linux" })

return result


def is_correct_version_url(version: str, url: str) -> bool:
pattern = r"releases/download/(\d+\.\d+\.\d+\-stable)/Godot_"
match = re.search(pattern, url)

if match:
return match.group(1) == version


if __name__ == "__main__":
owner: str = "godotengine"
repo: str = "godot"
Expand All @@ -157,5 +181,6 @@ def gen_v3_x64_releases(versions: list, v3_x64_urls: list) -> list:
godot_v3_urls: list = filter_godot_v3_link(urls)
godot_v4_x64_urls: list = gen_v4_x64_releases(versions, godot_v4_urls)
godot_v3_x64_urls: list = gen_v3_x64_releases(versions, godot_v3_urls)
releases: list = gen_releases(versions, godot_v3_x64_urls, godot_v4_x64_urls)

print(godot_v3_x64_urls)
print(releases)

0 comments on commit 6d56f23

Please sign in to comment.