Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
32 lines
950 B
Python
Executable File
32 lines
950 B
Python
Executable File
#!/usr/bin/env nix-shell
|
|
#!nix-shell --pure --keep NIX_PATH -i python3 -p git nix-update "python3.withPackages (ps: [ ps.beautifulsoup4 ps.requests ])"
|
|
|
|
import sys
|
|
import re
|
|
import requests
|
|
import subprocess
|
|
from bs4 import BeautifulSoup
|
|
|
|
VERSION_PATTERN = re.compile(r'^steam_(?P<ver>(\d+\.)+)tar.gz$')
|
|
|
|
found_versions = []
|
|
response = requests.get("https://repo.steampowered.com/steam/archive/stable/")
|
|
soup = BeautifulSoup (response.text, "html.parser")
|
|
for a in soup.find_all("a"):
|
|
href = a["href"]
|
|
if not href.endswith(".tar.gz"):
|
|
continue
|
|
|
|
match = VERSION_PATTERN.match(href)
|
|
if match is not None:
|
|
version = match.groupdict()["ver"][0:-1]
|
|
found_versions.append(version)
|
|
|
|
if len(found_versions) == 0:
|
|
print("Failed to find available versions!", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
found_versions.sort()
|
|
subprocess.run(["nix-update", "--version", found_versions[-1], "steam-unwrapped"])
|
|
found_versions[0]
|