Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 108 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ jobs:
# notarize separately below so it uses secret credentials, not a
# login-keychain profile.
bash scripts/build.sh mac --version "${{ needs.version.outputs.version }}" --no-notarize
[ -f .bazinga/work/Gen2Recomped.app/Contents/Resources/translation/rom-translate ] \
|| { echo "::error::rom-translate is missing from the macOS app"; exit 1; }

- name: Notarize & staple macOS app
if: vars.APPLE_SIGNING == 'true'
Expand Down Expand Up @@ -431,18 +433,97 @@ jobs:
# bills macOS minutes at 10x), and -- the point of the split -- a broken
# Xcode image or a disabled Homebrew cask can no longer stop the Windows
# build from happening.
# The offline translator is a PyInstaller one-file build, and PyInstaller
# does not cross-compile: rom-translate.exe can only be made on Windows.
# The macOS and Linux jobs build their own helper in place; the win64 job
# runs on Linux, so it had none -- build.sh skips a missing helper without
# a word, and every Windows release shipped "Offline translator is missing
# from this build". Build it here and hand it over.
windows-translator:
name: Windows offline translator
needs: version
runs-on: windows-latest
steps:
- uses: actions/checkout@v7

- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build offline translation helper
run: |
python -m pip install -r tools/translation/requirements.txt
python tools/translation/build_desktop.py

- uses: actions/upload-artifact@v7
with:
name: rom-translate-win
path: translation/rom-translate.exe
if-no-files-found: error
retention-days: 1

# The Linux helper, for both architectures, built inside Debian bullseye:
# glibc 2.31 is the oldest the AppImages promise (scripts/linux-arm64/
# Dockerfile), and a PyInstaller binary carries the glibc of the machine it
# was built on -- ubuntu-latest's would not start on a bullseye or 20.04
# system. arm64 feeds the arm64 AppImage and the RG34XXSP port, neither of
# which had any helper at all.
linux-translator:
name: Linux offline translator (${{ matrix.arch }})
needs: version
strategy:
matrix:
include:
- arch: x86_64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
container: python:3.12-slim-bullseye
steps:
- uses: actions/checkout@v7

- name: Build offline translation helper
run: |
set -eu
# PyInstaller reads shared-library dependencies with objdump
apt-get -o Acquire::Retries=3 update
apt-get install -y --no-install-recommends binutils
python -m pip install -r tools/translation/requirements.txt
python tools/translation/build_desktop.py
ls -l translation/rom-translate

- uses: actions/upload-artifact@v7
with:
name: rom-translate-linux-${{ matrix.arch }}
path: translation/rom-translate
if-no-files-found: error
retention-days: 1

windows:
name: Windows (win64)
needs: version
needs: [version, windows-translator]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: actions/download-artifact@v7
with:
name: rom-translate-win
path: translation

- name: Build Windows (win64)
run: |
set -euo pipefail
bash scripts/build.sh win --version "${{ needs.version.outputs.version }}"

# build.sh packs the helper only if it is there; a release must have it
- name: Verify the offline translator is packed
run: |
set -euo pipefail
listing="$(unzip -l dist/win/Gen2Recomped-win64.zip)"
grep -q "translation/rom-translate.exe" <<<"$listing" \
|| { echo "::error::rom-translate.exe is missing from the Windows zip"; exit 1; }

- name: Stage the Windows archive
run: |
set -euo pipefail
Expand Down Expand Up @@ -475,18 +556,17 @@ jobs:
# business needing it.
linux:
name: Linux (x86_64 AppImage)
needs: version
needs: [version, linux-translator]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: actions/setup-python@v6
- uses: actions/download-artifact@v7
with:
python-version: "3.12"
- name: Build offline translation helper
run: |
python -m pip install -r tools/translation/requirements.txt
python tools/translation/build_desktop.py
name: rom-translate-linux-x86_64
path: translation
- name: Mark the translator executable
run: chmod +x translation/rom-translate

# Never run `apt-get update` unconditionally: GitHub's
# azure.archive.ubuntu.com mirror stalls for 10-60 minutes at random
Expand All @@ -513,6 +593,8 @@ jobs:
run: |
set -euo pipefail
bash scripts/build.sh linux --version "${{ needs.version.outputs.version }}"
[ -f .bazinga/work/linux-appdir/translation/rom-translate ] \
|| { echo "::error::rom-translate is missing from the Linux AppImage"; exit 1; }

- name: Stage the Linux archive
run: |
Expand Down Expand Up @@ -760,12 +842,20 @@ jobs:
# on Linux is both faster and independently failable.
rg34xxsp:
name: Anbernic RG34XXSP (PortMaster)
needs: version
needs: [version, linux-translator]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v7

# the handheld is aarch64: the arm64 helper, not this runner's
- uses: actions/download-artifact@v7
with:
name: rom-translate-linux-arm64
path: translation
- name: Mark the translator executable
run: chmod +x translation/rom-translate

# zip, unzip, curl and file are ALL preinstalled on the ubuntu-latest
# runner image, so this step only has to cover a future image that
# drops one of them. Never run `apt-get update` unconditionally here:
Expand Down Expand Up @@ -793,7 +883,7 @@ jobs:
set -euo pipefail
# Payload comes from scripts/pack_love.sh, same as every other
# platform, so this pack cannot drift from the desktop build.
bash ./build-rg34xxsp.sh --version "${{ needs.version.outputs.version }}"
REQUIRE_TRANSLATOR=1 bash ./build-rg34xxsp.sh --version "${{ needs.version.outputs.version }}"

- name: Stage the pack
run: |
Expand Down Expand Up @@ -985,12 +1075,19 @@ jobs:
# ------------------------------------------------------------------ arm64
arm64:
name: Linux ARM64 AppImage
needs: [version, payload]
needs: [version, payload, linux-translator]
runs-on: ubuntu-24.04-arm
continue-on-error: true
steps:
- uses: actions/checkout@v7

- uses: actions/download-artifact@v7
with:
name: rom-translate-linux-arm64
path: translation
- name: Mark the translator executable
run: chmod +x translation/rom-translate

- uses: actions/download-artifact@v7
with:
name: game-love
Expand Down
14 changes: 14 additions & 0 deletions build-rg34xxsp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ for required in tools/rom_manifest_gold.json tools/rom_manifest_crystal.json \
[ -e "$GAME_SRC/$required" ] || fail "staged lovegame/ is missing $required"
done

# The offline translator (aarch64 only -- this is the handheld's CPU).
# worker.lua reads translation/rom-translate out of the game and copies it to
# the save directory before running it.
if [ -f "$ROOT/translation/rom-translate" ]; then
if file -b "$ROOT/translation/rom-translate" | grep -q "aarch64"; then
mkdir -p "$GAME_SRC/translation"
cp "$ROOT/translation/rom-translate" "$GAME_SRC/translation/"
else
say "translation/rom-translate is not aarch64; the port ships without it"
fi
fi
[ -n "${REQUIRE_TRANSLATOR:-}" ] && { [ -f "$GAME_SRC/translation/rom-translate" ] \
|| fail "REQUIRE_TRANSLATOR is set and no aarch64 translator was packed"; }

# Portable marker: saves + ROM cache live next to the game on the SD card.
: > "$GAME_SRC/portable.txt"

Expand Down
Loading
Loading