Files
psxrecomp/docs/ci/README.md
T
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

6.6 KiB

CI helpers for bundled releases

Shared scripts and GitHub Actions so every PSXRecomp title uses one standardized release flow: CI builds the title's committed generated/ game C and ships the compiled game.

Start here: ../GAME_PROJECT_SETUP.md, then BUNDLED_RELEASES.md for what ships and why.

Workflow template

New Project Layout (tools/new_project_layout/setup_project.{sh,ps1}) copies this template into the title repo and replaces YOUR_* / yourgame-release using --zip-prefix (or a derived acronym) plus the window title. It also writes scripts/package_release.sh, README.md, and an optional framework_pins.txt snapshot, and can opt in wizard/netplay via --enable-wizard / --enable-netplay. Release CI pins via submodule gitlinks and only logs SHAs with record_pins.sh (no verify_pins gate).

Existing titles: tools/generate_ci writes (and --checks) the filled workflow; Project Studio (tools/new_project_layout/migrate_project.py apply / gui) emits the same packager wrapper + release.yml and un-ignores generated/.

Manual:

mkdir -p .github/workflows
cp psxrecomp/docs/ci/templates/game-release.yml .github/workflows/release.yml
# edit YOUR_* placeholders — or use fill_tokens.py --ci-placeholders
# Release name is YAML-quoted so titles with ':' (e.g. Marvel vs. Capcom: …) parse.

Template: templates/game-release.yml

Versioning: workflow_dispatch with an empty version auto-bumps the next X.Y.Z from the latest v*.*.* git tag (bump: patch / minor / major; default patch). Pass an explicit version to override. Shared helper: tools/ci/normalize_version.sh --next [patch|minor|major].

Matrix: ubuntu-24.04 (linux-x64), windows-2022 (windows-x64), macos-15 (macos-arm64), macos-15-intel (macos-x64).

Release builds always configure with Vulkan headers + glslc (MSYS2 / apt / Homebrew packages), verify vulkan.h + glslc before configure, and fail the job if CMake does not select PSX_HAVE_VULKAN. Runtime still loads the ICD dynamically via SDL; CI only needs headers and the shader compiler.

Tools under psxrecomp/tools/

Script Role
ci/normalize_version.sh Normalize / write VERSION + TAG; --next auto-bumps from latest tag
ci/check_boot_exe.sh The three copies of the boot-EXE name agree
ci/check_generated.sh Committed game C present + tracked; no retail BIOS C; no BIOS dump
ci/generate_openbios.sh Emit the OpenBIOS backend C in CI from the bundled MIT image
ci/record_pins.sh Log psxrecomp / recomp-ui / recomp-net SHAs (CI + scaffold)
ci/verify_pins.sh Optional local check vs framework_pins.txt (not used by release CI)
ci/build_emitters.sh Build psxrecomp-game + psxrecomp-bios
ci/sign_windows.sh Authenticode-sign the staged Windows binaries (no-op without a certificate)
fetch_toolchain.sh Download/unpack cmake-clang-v1 (Windows emitter builds on the CI machine only)
package_game_release.sh Bundled zip: compiled game + runtime data + OpenBIOS + mods + overlay toolchain
release_stage.py Shared staging surface (mod catalog, overlay toolchain, overlay cache tag/shards)
bundle_mingw_dlls.sh Copy imported non-system DLLs next to Windows PEs
templates/game.gitignore Suggested gitignore for title repos (generated/ tracked)

package_setup_host.sh / stage_setup_sdk.sh are the retired setup-host packagers; they are not part of the release flow.

Composite actions

- uses: ./psxrecomp/.github/actions/build-emitters
- uses: ./psxrecomp/.github/actions/fetch-toolchain   # Windows emitter build only

Title responsibilities

Keep only this in the game repo:

  • generated/ committed, regenerated (and re-committed) whenever seeds, codegen settings, or the framework pin change
  • CMake via psxrecomp_add_game_runtime with GEN_MARKER / GEN_FULL_GLOB naming the committed C, and the wizard on (first-run disc picker)
  • Thin codegen_setup.c / .h with psx_game_codegen_forward_if_built (scaffold: tools/new_project_layout/templates/codegen_setup.c.in) — main.cpp always calls it; in a full build it is a no-op
  • For netplay titles: PSX_NETPLAY ON before include(runtime.cmake) (ENABLE_NETPLAY_IF_PRESENT alone is too late), plus -DPSX_NETPLAY=ON in the release workflow configure step
  • Thin scripts/package_release.sh wrapping package_game_release.sh
  • Zip prefix / display name / disc hint in that wrapper
  • Release notes / GitHub Release job naming

Release CI configures with -DPSXRECOMP_REQUIRE_GAME_C=ON after check_generated.sh and generate_openbios.sh, and asserts from the configure log that the generated game C and the OpenBIOS backend were linked.

Windows code signing

Windows 11 Smart App Control (on by default on new installs) allows an executable only if it carries a valid Authenticode signature or its exact hash already has reputation. Every CI build is a new hash, so an unsigned release is blocked outright, with no "run anyway".

package_game_release.sh therefore runs tools/ci/sign_windows.sh over the staged tree before zipping. It signs the game exe and every DLL (the overlay_toolchain/ bundle is left alone) with SHA-256 and an RFC 3161 timestamp, then verifies each file.

Secret / variable Meaning
WINDOWS_SIGN_PFX_BASE64 the PKCS#12 certificate, base64 (base64 -w0 cert.pfx)
WINDOWS_SIGN_PFX_PASSWORD its password (omit for a passwordless .pfx)
WINDOWS_SIGN_TIMESTAMP_URL optional; default http://timestamp.digicert.com
WINDOWS_SIGN_DESCRIPTION optional; text shown in the file's properties / UAC

No certificate = no signing, and the build still succeeds (a notice is printed). A certificate that is present but fails to sign is fatal. The workflow template passes the two secrets to the Package game zip step; forks without them package unsigned exactly as before.

Certificate choice: an OV certificate satisfies Smart App Control at once, while SmartScreen reputation still builds over downloads. An EV certificate or Azure Trusted Signing is trusted by both immediately. Trusted Signing does not hand out a .pfx; wiring it means a different signing step, not this script.

Because the shipped executable is the game, the signature now covers what the player runs. The setup-host model could not offer that: the binary players ran was built on their own machine after Generate and carried no signature.

Release checklist

See ../GAME_PROJECT_SETUP.md.