skate3recomp-multiplayer/docs/releases.md
MiTHRAL 81189576c0 releases: harden for Windows + one-click windows-build.cmd launcher
Addresses the known Windows build issues (see /mnt/archive/Issues.txt):
- windows-build.cmd: loads vcvarsall with a stable Windows SDK (WINSDK,
  default 10.0.26100.0) fixing kernel32.lib LNK1104; sets
  MSYS2_ARG_CONV_EXCL=* so Git Bash does not corrupt %LIB%; inits submodules
  (including the broken-pin self-heal) before building.
- release.sh: auto-detect the Title Update package (repo root or game dir);
  zip fallback to 7z or PowerShell Compress-Archive (Git Bash has no zip);
  upload JSON parsing falls back from python3/python to grep (Git Bash ships
  neither python).
2026-08-27 14:02:24 -04:00

129 lines
No EOL
5.9 KiB
Markdown

# Releases
Releases are prebuilt binaries that players download so they only need their
own Skate 3 ISO — **no building from scratch**. This project does not and
cannot ship game content; the release zip is just the recompiled binaries.
## What's in a release (and what isn't)
A release zip (`Skate3Recomp-Linux-<ver>.zip`) contains only:
- `skate3` — the recompiled game binary (also the in-app **ISO installer**)
- `librexruntime.so` (Linux) / `librexruntime.dll` (Windows) /
`librexruntime.dylib` (macOS)
- `ghost_relay` — the multiplayer relay server binary
- `README.md`
- `game/default.xexp` + `game/data/webkit/EAWebkit.xexp` — **only** when the
build used the Title Update package (these are the recompiled update
patches, not retail content)
**No game files.** Players download the zip, run `skate3`, click "Select
ISO", and the built-in installer extracts their own legally-owned copy. The
game dump (`default.xex` + `data/webkit/EAWebkit.xex`) is required **only at
build time** — codegen mechanically translates the actual Xbox 360 binary
into C++ source, which is what gets compiled. It is never included in, or
uploaded with, a release.
## Option A — build locally, upload manually (recommended)
You already build successfully on your machine, so this is the simple path:
```sh
# on your build machine, from the repo root
./tools/release/release.sh # build + package this platform
./tools/release/release.sh --tag v1.0.0 --upload # build + publish to Forgejo
```
The script builds (configure → codegen → build), packages the zip (binaries
+ `librexruntime.so` + `ghost_relay` + README + TU patches if used), prints a
`sha256sum`, and with `--upload` creates/updates a Forgejo Release and
attaches the zip.
`--upload` needs:
- `GITEA_TOKEN` — a Forgejo token with **write:repository** scope (Settings →
Applications → Generate New Token), covering the release APIs.
- Optional `FORGEJO_REPO` (default `ad3laid3/skate3recomp-multiplayer`) and
`FORGEJO_INSTANCE` (default `https://git.mithraic.cloud`).
Per-platform notes:
| Platform | Build machine | Command |
|---|---|---|
| Linux | any Linux with the toolchain (README: Ubuntu 24.04 + Clang 20) | `./tools/release/release.sh` |
| Windows | a **Windows** machine (Visual Studio MSVC + Windows SDK, D3D12) | `tools\release\windows-build.cmd` (see below) |
| macOS | an **Apple Silicon/Intel Mac** (Homebrew LLVM + MoltenVK, per README) | `./tools/release/release.sh` |
Cross-compiling Windows/macOS from a Linux box is not practical for this
stack (D3D12 needs the Windows SDK, Cocoa/MoltenVK need a Mac), so each
platform's release is built on that platform.
### Windows build
On a Windows box, the known build issues (multiple Windows SDKs, Git Bash
`%LIB%` mangling, missing submodules) are handled by the launcher:
```bat
tools\release\windows-build.cmd --tag v2.0.2-mp1 --upload
```
It loads the MSVC environment (`vcvarsall.bat x64 <SDK>`), sets
`MSYS2_ARG_CONV_EXCL=*` so Git Bash doesn't corrupt `%LIB%`, initializes the
submodules (including the self-heal), and runs `release.sh`. Config via env:
- `VCVARSALL` — path to `vcvarsall.bat` (default: VS 18 Community x64).
- `WINSDK` — Windows SDK version (default `10.0.26100.0`; try `10.0.22621.0`
if yours differs — a broken SDK default is what causes `kernel32.lib`
`LNK1104`).
- `GITBASH` — path to Git for Windows `bash.exe`.
`release.sh` now auto-detects the Title Update package (repo root or
`game/`), falls back to PowerShell `Compress-Archive` when `zip` is missing,
and no longer requires `python3` for the upload JSON parsing. The Windows
build also needs the game dump (`game/default.xex` + `EAWebkit.xex`) and the
TU package present on that box (build-time only, never shipped).
## Option B — automated via Forgejo Actions (optional)
`.forgejo/workflows/release.yml` builds and publishes Linux releases on push
of a `v*` tag (or a manual run), on a self-hosted runner.
Requirements for the automation path:
1. **A runner with the game dump.** Codegen needs the `.xex` files at build
time. On the runner, put the extracted dump at `/opt/skate3-game`
(`default.xex` + `data/webkit/EAWebkit.xex`, optionally the
`TU_12K2276_*` package). If your runner is a Docker container, mount that
directory into it (`-v /opt/skate3-game:/opt/skate3-game`). The game files
stay on the runner — they are never uploaded to the repo.
2. **Secrets** on the repo:
- `SUBMODULE_KEY` — an SSH deploy key with read access to
`ad3laid3/rexglue-skate3` (the self-hosted rexglue fork submodule).
- `RELEASE_TOKEN` — a Forgejo token with `write:repository` scope.
3. **Runner label** — the workflow uses `runs-on: ubuntu-24.04`; match it to
your runner's label (Docker runners commonly use
`ubuntu-latest`/`ubuntu-22.04`/`ubuntu-24.04` — change the `runs-on` line
to match).
4. **Broken submodule pins.** A fresh recursive clone currently fails because
the rexglue fork pins `thirdparty/imgui` to a commit `ocornut/imgui` no
longer carries. `tools/ci/init-submodules.sh` self-heals this (checks out
the upstream default tip for any nested submodule left empty) and the
workflow calls it after `git submodule update --init`.
Windows/macOS jobs can be added to the same workflow when native
Windows/macOS runners are available (each job uses its platform preset and
artifact names; the package step is per-OS).
## Doing it by hand
If you'd rather not use the script, the equivalent steps are:
```sh
cmake --preset linux-relwithdebinfo -DSKATE3_GAME_DATA_ROOT="$PWD/game" # add -DSKATE3_TITLE_UPDATE_PACKAGE=... if used
cmake --build --preset linux-relwithdebinfo --target generate-all --parallel
cmake --preset linux-relwithdebinfo -DSKATE3_GAME_DATA_ROOT="$PWD/game"
cmake --build --preset linux-relwithdebinfo --parallel
# zip out/build/linux-relwithdebinfo/{skate3,librexruntime.so,ghost_relay} + README
```
Then create a Release in the Forgejo web UI (`<repo> → Releases → New
Release`) and attach the zip.