publish-public: a platform missing from the manifest keeps its alias on the file the current vercel.json names while that file exists (a staggered publish dropped the Windows alias)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-09 07:24:40 +00:00
parent a7cd94d0eb
commit c9dee6a75b

View file

@ -141,9 +141,14 @@ if [ -n "$HIVE" ]; then
fi
# the aliases: what the two manifests and the newest HiveOS package in dl/public/ name, nothing else
ALIASES_JSON="$(python3 - "$PUB" "$DRY" <<'PY'
ALIASES_JSON="$(python3 - "$PUB" "$DRY" "$DLSITE/vercel.json" <<'PY'
import json, os, re, sys
pub, dry = sys.argv[1], sys.argv[2] == "1"
pub, dry, current = sys.argv[1], sys.argv[2] == "1", sys.argv[3]
# a staggered publish (Mac first, Windows later) leaves the manifest without the other platforms: their aliases keep the
# file the current vercel.json names while that file is still in dl/public/ (9 October 2026; before this the alias was
# dropped and /public/igneum-miner-windows.exe answered 404 until the Windows entry came)
try: previous = {r["source"].rsplit("/", 1)[1]: r["destination"].rsplit("/", 1)[1] for r in json.load(open(current)).get("rewrites", []) if r["source"].startswith("/public/")}
except Exception: previous = {}
def entry(name, plat):
p = os.path.join(pub, name)
if not os.path.exists(p): return None
@ -151,13 +156,17 @@ def entry(name, plat):
if not e: return None
f = e["url"].rsplit("/", 1)[1]
return f if os.path.exists(os.path.join(pub, f)) or dry else None
def kept(alias, plat_entry):
if plat_entry: return plat_entry
f = previous.get(alias)
return f if f and os.path.exists(os.path.join(pub, f)) else None
hive = sorted([f for f in os.listdir(pub) if re.fullmatch(r"igneum-hive-\d+\.\d+\.\d+\.tar\.gz", f)],
key=lambda f: tuple(int(x) for x in re.findall(r"\d+", f)[:3])) if os.path.isdir(pub) else []
aliases = {
"igneum-miner-windows.exe": entry("igneum-app-latest.json", "windows"),
"igneum-miner-mac.dmg": entry("igneum-app-latest.json", "mac"),
"igneum-miner-windows.exe": kept("igneum-miner-windows.exe", entry("igneum-app-latest.json", "windows")),
"igneum-miner-mac.dmg": kept("igneum-miner-mac.dmg", entry("igneum-app-latest.json", "mac")),
"igneum-miner-hive.tar.gz": hive[-1] if hive else None,
"igneum-wallet-mac.dmg": entry("igneum-wallet-latest.json", "mac"),
"igneum-wallet-mac.dmg": kept("igneum-wallet-mac.dmg", entry("igneum-wallet-latest.json", "mac")),
}
print(json.dumps(aliases))
PY