publish-public: a platform the manifest lacks keeps the newest versioned file already in dl/public, stamped with its own version (a staggered publish never darkens a link or names an absent version)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-06 19:44:56 +00:00
parent a17d8a6cac
commit 31f7bcddf8

View file

@ -123,11 +123,21 @@ fi
ALIASES_JSON="$(python3 - "$PUB" "$DRY" <<'PY'
import json, os, re, sys
pub, dry = sys.argv[1], sys.argv[2] == "1"
# a platform the current manifest lacks keeps the newest versioned file of that platform already in dl/public/ (6 October
# 2026, 0.3.15: the Mac row moved first while the Windows installer waited on the GitHub billing block; the Windows link of the site
# must stay on the version that exists, never go dark, and never name a version that is not there). The index below
# reads such a file"s version from its name, so the site stamps the carried version honestly.
CARRY = {"windows": r"Igneum-Miner-Setup-(\d+\.\d+\.\d+)\.exe", "mac": r"Igneum-Miner-(\d+\.\d+\.\d+)\.dmg"}
def newest(pattern):
fs = [f for f in os.listdir(pub) if re.fullmatch(pattern, f)] if os.path.isdir(pub) else []
fs.sort(key=lambda f: tuple(int(x) for x in re.findall(r"\d+", f)[:3]))
return fs[-1] if fs else None
def entry(name, plat):
p = os.path.join(pub, name)
if not os.path.exists(p): return None
e = json.load(open(p)).get("platforms", {}).get(plat)
if not e: return None
if not e:
return newest(CARRY[plat]) if name == "igneum-app-latest.json" and plat in CARRY else None
f = e["url"].rsplit("/", 1)[1]
return f if os.path.exists(os.path.join(pub, f)) or dry else None
hive = sorted([f for f in os.listdir(pub) if re.fullmatch(r"igneum-hive-\d+\.\d+\.\d+\.tar\.gz", f)],
@ -178,6 +188,9 @@ def sha(p):
def version_of(name, f):
if name.startswith("igneum-miner-hive"): return ".".join(re.findall(r"\d+", f)[:3])
m = json.load(open(os.path.join(pub, "igneum-wallet-latest.json" if name.startswith("igneum-wallet") else "igneum-app-latest.json")))
plat = "windows" if name == "igneum-miner-windows.exe" else "mac"
if name.startswith("igneum-miner") and not m.get("platforms", {}).get(plat):
return ".".join(re.findall(r"\d+", f)[:3]) # a carried file: the version in its name, not the one of the manifest
return m.get("version")
keys = {"igneum-miner-windows.exe": "miner-windows", "igneum-miner-mac.dmg": "miner-mac", "igneum-miner-hive.tar.gz": "miner-hive", "igneum-wallet-mac.dmg": "wallet-mac"}
files = {}