skate3recomp-multiplayer/tools/ci/init-submodules.sh
MiTHRAL 7173d7e88d releases: local build+upload script, optional Forgejo Actions workflow, docs
Clarifies that releases ship ONLY the recompiled binaries (skate3 +
librexruntime + ghost_relay + README) - never the game files; the game dump
(default.xex + EAWebkit.xex) is required at BUILD TIME for codegen only.

- tools/release/release.sh: builds + packages a per-platform release zip
  (configure -> codegen -> build -> zip), prints a sha256sum, and with
  --upload creates/updates a Forgejo Release and attaches the zip via the
  API (GITEA_TOKEN). Supports linux/windows/macos presets on their native
  hosts.
- .forgejo/workflows/release.yml: optional automation - builds on a
  self-hosted Docker runner (ubuntu-24.04 label), self-heals the broken
  nested submodule pins via tools/ci/init-submodules.sh, and publishes a
  Linux release on v* tags. Needs the game dump mounted on the runner
  (codegen only, never uploaded), SUBMODULE_KEY + RELEASE_TOKEN secrets.
- tools/ci/init-submodules.sh: recursive submodule init that self-heals
  upstream pins a fresh clone can no longer fetch (the rexglue fork pins
  thirdparty/imgui to a commit ocornut/imgui dropped; the script checks out
  the upstream default tip for any nested submodule left empty).
- docs/releases.md: what's in a release, the local path, and the optional
  CI path.
- .gitignore: keep tools/ci + tools/release, ignore local release zips.
2026-08-26 23:32:13 -04:00

40 lines
No EOL
1.5 KiB
Bash
Executable file

#!/usr/bin/env bash
# Recursive submodule init for the rexglue SDK with self-healing for broken
# upstream pins.
#
# The rexglue fork pins several nested third-party submodules (imgui, ...) to
# commits their upstreams no longer carry, so a plain
# `git submodule update --init --recursive` aborts at the first broken pin
# and leaves every later nested submodule empty (a fresh clone cannot build).
# For each nested submodule still left empty, this script fetches its origin
# and checks out the default-branch tip, which is enough to build.
#
# Run from the repository root after `git submodule update --init` (top
# level). No-op when everything initialized fine.
set -uo pipefail
SDK="third_party/rexglue-sdk"
if [ ! -e "$SDK/.git" ]; then
echo "init-submodules: $SDK is not initialized (run git submodule update --init first)"
exit 1
fi
(
cd "$SDK"
git submodule update --init --recursive --jobs 4 >/tmp/ghost_sub_init.log 2>&1 || true
while IFS= read -r path; do
if [ ! -d "$path" ] || [ -z "$(ls -A "$path" 2>/dev/null)" ]; then
echo "init-submodules: self-healing empty submodule $path"
if (cd "$path" && git fetch --depth 1 origin >/dev/null 2>&1 &&
git checkout -q FETCH_HEAD >/dev/null 2>&1); then
echo " ok: $path -> $(git -C "$path" rev-parse --short HEAD)"
else
echo " WARN: could not self-heal $path (build may fail on this dependency)"
fi
fi
done < <(git config --file .gitmodules --get-regexp '^submodule\..*\.path$' | awk '{print $2}')
)
exit 0