Files
psxrecomp/.github/workflows/release.yml
T
Matthew Stanley 07dab8fd34 chore: add GitHub Actions release workflow
Adapted from SuperMarioWorldRecomp's release.yml. Triggers on tag push
(v*) and workflow_dispatch. Builds psx-runtime in Release on
windows-latest under MSYS2 mingw64, stages the exe + SDL2 + mingw
runtime DLLs + LICENSE + a release README + bios/saves placeholders,
zips as psxrecomp-v2-windows-x64.zip, and attaches it to a GitHub
Release on tag builds.

Caveat: the recompiler step needs a real BIOS to operate on, which CI
does not have. The current workflow is a scaffold — it builds the
runtime artefact correctly but the recompile step will fail unless
the BIOS is supplied via a secret or a separate ingest step. Wire up
end-to-end before relying on tag builds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 18:08:47 -07:00

130 lines
4.2 KiB
YAML

name: Build & Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up MSYS2 mingw64
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-SDL2
# The recompiler needs a BIOS to operate on. CI does NOT distribute
# a BIOS. We ship a release that runs against the user's own BIOS
# — so for CI we generate against a placeholder BIOS file just to
# exercise the build path, then DISCARD the generated/ output before
# zipping. The runtime binary itself is what we ship; users provide
# their own SCPH1001.BIN at runtime and regenerate locally.
#
# NOTE: a real release pipeline would either (a) check in a tiny
# synthetic BIOS that exercises the recompiler, or (b) skip the
# recompiler step entirely and ship a runtime binary that loads
# the BIOS via dlopen-style runtime linkage. Today we do neither;
# the workflow is a scaffold for future tag-driven builds and is
# not yet wired end-to-end.
- name: Build recompiler
run: |
cmake -S recompiler -B recompiler/build -G Ninja \
-DCMAKE_BUILD_TYPE=Release
cmake --build recompiler/build
- name: Build runtime
run: |
cmake -S runtime -B runtime/build -G Ninja \
-DCMAKE_BUILD_TYPE=Release
cmake --build runtime/build --target psx-runtime
- name: Stage release artifacts
run: |
stage="release-stage"
mkdir -p "$stage/bios" "$stage/saves"
cp runtime/build/psx-runtime.exe "$stage/"
# Bundle runtime DLLs from the mingw64 install
for dll in SDL2.dll libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll; do
cp "/mingw64/bin/$dll" "$stage/"
done
# Placeholder so users know where to drop the BIOS
cat > "$stage/bios/PUT_SCPH1001.BIN_HERE.txt" <<EOF
Place your legally-obtained Sony SCPH1001 BIOS dump here, named
exactly: SCPH1001.BIN
PSXRecomp does not distribute a BIOS. See README.md.
EOF
# Release README
cat > "$stage/README.txt" <<EOF
PSXRecomp v2 (Windows x64) — heavy WIP
USAGE
1. Place your own SCPH1001.BIN in the bios/ folder.
2. Run psx-runtime.exe.
3. With no disc, the BIOS goes to its built-in memory card
management UI.
KEYBOARD
Arrow keys D-Pad
X / Z / S / A Cross / Square / Circle / Triangle
Q / W L1 / R1
E / R L2 / R2
Enter Start
Right Shift Select
Tab (hold) Fast-forward (turbo, no render)
MEMORY CARDS
Stored in saves/card1.mcd and saves/card2.mcd. 128 KB raw
PS1 memory card images, interchangeable with PCSX-Redux,
Duckstation, ePSXe, mednafen, etc.
STATUS
CD-ROM / disc-based game loading is untested and almost
certainly does not work. The supported use right now is
BIOS-only memcard management.
See https://github.com/mstan/psxrecomp for source and a full
status breakdown.
EOF
# Bundle LICENSE
cp LICENSE "$stage/"
ls -la "$stage/"
- name: Zip release
run: |
cd release-stage
7z a -tzip ../psxrecomp-v2-windows-x64.zip .
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: psxrecomp-v2-windows-x64
path: release-stage/
- name: Create GitHub Release (tag builds only)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: psxrecomp-v2-windows-x64.zip
generate_release_notes: true