Files
Alex Vanderveen 874df9b5bb release: ship bundled, compiled games from committed generated/ C
Retire the setup-host release model (CI wiped generated/ and shipped
emitters + sources + a wizard so every player regenerated and rebuilt the
title). Titles now commit generated/ and CI ships the compiled game.

- docs/ci/templates/game-release.yml replaces setup-release.yml: gate on
  committed game C (tools/ci/check_generated.sh), emit the OpenBIOS backend
  in CI (tools/ci/generate_openbios.sh), configure with
  PSXRECOMP_REQUIRE_GAME_C=ON and assert the full path was taken, package
  with tools/package_game_release.sh, verify the zip is a game not a kit.
- tools/package_game_release.sh: exe, assets, bundled OpenBIOS, configs, mod
  catalog + overlay toolchain via release_stage.py, notices; refuses sources,
  emitters, generated C, BIOS dumps. clear_generated.sh removed;
  package_setup_host.sh marked retired.
- Scaffold: gitignore templates track generated/, package_release.sh.in
  wrapper, setup_project.{sh,ps1} commit generated/ after Generate.
- Project Studio: audit flags ignored/untracked generated/, retail BIOS C
  and setup-host workflows; merge_gitignore un-ignores generated/; ops emit
  the bundled packager + workflow; generate_ci uses the new template.
- Docs: docs/ci/BUNDLED_RELEASES.md replaces HOST_ONLY_RELEASES.md.
- Tests: tools/tests/test_bundled_release_layout.py; fix pre-existing
  false positives in the packager-surface and overlay-static tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-30 17:11:14 -04:00

51 lines
1.6 KiB
Python

"""Locate toolkit roots (templates, CI helpers) relative to this package."""
from __future__ import annotations
from pathlib import Path
def toolkit_dir() -> Path:
"""tools/new_project_layout/"""
return Path(__file__).resolve().parent.parent
def templates_dir() -> Path:
return toolkit_dir() / "templates"
def psxrecomp_root_from_toolkit() -> Path | None:
"""If this toolkit lives inside a psxrecomp checkout, return that root."""
# …/psxrecomp/tools/new_project_layout/project_studio
candidate = toolkit_dir().parent.parent
if (candidate / "runtime" / "runtime.cmake").is_file():
return candidate
return None
CI_RELEASE_TEMPLATE = "game-release.yml"
def ci_release_template(game_root: Path | None = None) -> Path | None:
"""The bundled-release workflow template (docs/ci/templates/game-release.yml).
Prefer the game's own psxrecomp submodule so the workflow matches the
framework the project pins; fall back to the toolkit's parent psxrecomp.
A submodule pinned before bundled releases has no such template, and the
caller says so rather than silently installing the retired setup-host one.
"""
if game_root is not None:
for sub in ("psxrecomp", "psxrecomp-v4"):
p = game_root / sub / "docs" / "ci" / "templates" / CI_RELEASE_TEMPLATE
if p.is_file():
return p
root = psxrecomp_root_from_toolkit()
if root is None:
return None
p = root / "docs" / "ci" / "templates" / CI_RELEASE_TEMPLATE
return p if p.is_file() else None
# Retired name, kept so a caller pinned to it still resolves.
ci_setup_release_template = ci_release_template