Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ coverage.xml
# Generated site catalog (rebuilt in CI)
site/catalog.json
site/history.json
site/summary.json

# Local GitHub setup helpers (not part of the catalog)
.github-setup/
Expand Down
11 changes: 11 additions & 0 deletions site/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import json
import subprocess
import sys
from datetime import UTC, datetime
from pathlib import Path

ROOT = Path(__file__).resolve().parent.parent
DATA = ROOT / "data" / "cpu"
OUT = Path(__file__).resolve().parent / "catalog.json"
HISTORY = Path(__file__).resolve().parent / "history.json"
SUMMARY = Path(__file__).resolve().parent / "summary.json"


def git(*args: str) -> str:
Expand Down Expand Up @@ -50,6 +52,15 @@ def main() -> int:
)
OUT.write_text(json.dumps(records, indent=2) + "\n", encoding="utf-8")
print(f"wrote {OUT} ({len(records)} ES records)")
# TechAPI's homepage counts satellites from summary.json rather than by
# downloading a record listing — game-catalog is ~1M records, so reading
# a catalog's .length stopped being viable there.
summary = {
"count": len(records),
"generated_at": datetime.now(UTC).strftime("%Y-%m-%dT%H:%M:%SZ"),
}
SUMMARY.write_text(json.dumps(summary, indent=2) + "\n", encoding="utf-8")
print(f"wrote {SUMMARY} ({len(records)} records)")
history = build_history()
HISTORY.write_text(json.dumps({"points": history}, indent=2) + "\n", encoding="utf-8")
print(f"wrote {HISTORY} ({len(history)} points)")
Expand Down
Loading