mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-19 16:20:01 -04:00
On Linux the game's Options screen was never named for the renderer, so the options' tabs did not come and there was no way to Triforce's options at all. host/oot_menu.c names it on every system now. The Linux AppImage workflow can be started with the version its build names itself. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
176 lines
9.1 KiB
YAML
176 lines
9.1 KiB
YAML
# The Linux AppImage (x86_64): Hookshot Builder with the compiler, Python, libraries and the Vulkan back end it builds the
|
|
# game with on the player's PC (scripts/linux/deps.sh, scripts/linux/appimage.sh). No game data is involved.
|
|
# Built in Ubuntu 22.04, the oldest system it is for (glibc 2.35). A workflow artifact on every run; on a tag, also an
|
|
# asset of that tag's release (scripts/release_upload.sh, shared with the Windows builder workflow).
|
|
name: Linux AppImage
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['*']
|
|
pull_request:
|
|
workflow_dispatch:
|
|
inputs:
|
|
# (a build that replaces a release's Linux file names that release: a game built from it compares its version with
|
|
# the latest release's tag by name (host/hos_update.c), and git describe's v0.3.6-1-g... would be told of v0.3.6)
|
|
version:
|
|
description: "The version the AppImage names itself (empty: git describe's)"
|
|
required: false
|
|
default: ''
|
|
permissions:
|
|
contents: read
|
|
concurrency:
|
|
group: linux-appimage-${{ github.ref }}
|
|
# (a pull request's older run is cancelled; a push's or a tag's never is)
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
appimage:
|
|
# (builder-parts holds the installer's parts: no AppImage there, and it must never be made "latest")
|
|
if: github.ref_name != 'builder-parts' && github.ref_name != 'linux-parts'
|
|
runs-on: ubuntu-latest
|
|
container: ubuntu:22.04
|
|
# (about 4 minutes with the dependencies cached; building them all, as a release does, takes longer)
|
|
timeout-minutes: 60
|
|
steps:
|
|
- name: System packages
|
|
env:
|
|
DEBIAN_FRONTEND: noninteractive
|
|
run: |
|
|
# Retry the entire bootstrap: even the first index refresh or the toolchain setup can fail while a mirror syncs.
|
|
# Every attempt refreshes the signed indexes; no stale-index or authentication checks are bypassed.
|
|
for try in 1 2 3; do
|
|
# (libstdc++ 13, from the toolchain PPA: C++20 <format>; linked in statically)
|
|
if apt-get update &&
|
|
apt-get install -y --no-install-recommends software-properties-common gpg-agent &&
|
|
add-apt-repository -y ppa:ubuntu-toolchain-r/test &&
|
|
apt-get install -y --no-install-recommends g++-13 libstdc++-13-dev &&
|
|
apt-get install -y --no-install-recommends git ca-certificates curl xz-utils zstd file unzip python3 \
|
|
build-essential gcc-12 g++-12 libstdc++-12-dev nasm meson ninja-build cmake pkg-config \
|
|
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev libxfixes-dev libxinerama-dev \
|
|
libxkbcommon-dev libwayland-dev wayland-protocols libdecor-0-dev libegl-dev libgles-dev libdrm-dev libgbm-dev \
|
|
libpulse-dev libasound2-dev libpipewire-0.3-dev libudev-dev libdbus-1-dev libxft-dev libfontconfig1-dev zlib1g-dev; then
|
|
break
|
|
else
|
|
package_status=$?
|
|
fi
|
|
if [ "$try" = 3 ]; then exit "$package_status"; fi
|
|
sleep 20
|
|
done
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Trust the checkout
|
|
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
# (a release builds what the AppImage carries from its checked downloads: no built deps from a cache, which other
|
|
# runs write. Other runs take the built deps)
|
|
- if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: build-linux/deps
|
|
key: linux-deps-${{ hashFiles('scripts/linux/deps.sh', 'requirements.txt', 'nx2/prompt_requirements.txt') }}
|
|
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: build-linux/deps/downloads
|
|
key: linux-deps-downloads-${{ hashFiles('scripts/linux/deps.sh') }}
|
|
|
|
- name: Dependencies (LLVM, Python, FFmpeg with dav1d, SDL2, Vulkan headers)
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: scripts/linux/deps.sh
|
|
|
|
# work/: the lists and the play profile made on the development PC (addresses and counts, no game code). When the
|
|
# repository does not carry them, the ones in the latest release's app part (named by its hookshot-setup.txt) are
|
|
# used; without either the game is built all the same, a little slower in play.
|
|
# (not this tag's own release: the Windows builder workflow can make it before this step runs. A fork with no release
|
|
# takes upstream's. Downloads are retried: GitHub answers 504 now and then)
|
|
- name: Play profile
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
SKIP_TAG: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '' }}
|
|
run: |
|
|
if [ -f work/hot_order.txt ]; then echo "work/ is in the repository"; exit 0; fi
|
|
python3 -I scripts/release_parts.py previous /tmp/setup.txt --repo "$GITHUB_REPOSITORY" --repo NotRexed/Hookshot \
|
|
--skip-tag "$SKIP_TAG" ||
|
|
{ echo "no release with a setup list: built without the profile"; exit 0; }
|
|
python3 -I scripts/release_parts.py profile /tmp/setup.txt work ||
|
|
{ echo "the profile did not download: built without it"; exit 0; }
|
|
ls -la work work/image
|
|
|
|
- name: AppImage
|
|
env:
|
|
HOOKSHOT_VERSION: ${{ inputs.version }} # (empty but for a started run that names one: appimage.sh asks git then)
|
|
run: scripts/linux/appimage.sh
|
|
|
|
# (AMD FSR 4's Linux side, a build option the AppImage leaves off (gpu/vk/vk_fsr4.cpp: dlopen, the older backend
|
|
# description, the unit exposure; the descriptor buffers in vk_main.cpp): built once more in a copy of the back end's
|
|
# work folder, where only vk_fsr4.cpp compiles again. The AppImage above is not changed)
|
|
- name: triforce_vk.so with AMD FSR 4 (build check)
|
|
shell: bash # (this container's default is sh, which has no PIPESTATUS)
|
|
run: |
|
|
cp -r build-linux/vk-work "$RUNNER_TEMP/vk-fsr"
|
|
rm -f "$RUNNER_TEMP/vk-fsr/sa/build/triforce_vk.so" # (the AppImage's own, without FSR: the test below is this build's)
|
|
D="$PWD/build-linux/deps"
|
|
OOT_WORK="$RUNNER_TEMP/vk-fsr" EMSDK="$D/emsdk" RX_CPM="$D/cpm" RX_MARCH=x86-64-v3 RX_VK_ONLY=1 RX_RELEASE=1 HOOKSHOT_FSR=1 \
|
|
"$D/python/bin/python3" -I nx2/build.py --standalone --jobs "$(nproc)" |
|
|
tee "$RUNNER_TEMP/vk-fsr.log"
|
|
test "${PIPESTATUS[0]}" -eq 0
|
|
grep -q "with AMD FSR 4" "$RUNNER_TEMP/vk-fsr.log"
|
|
test -f "$RUNNER_TEMP/vk-fsr/sa/build/triforce_vk.so"
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: Hookshot-linux-x86_64
|
|
path: build-linux/*.AppImage
|
|
if-no-files-found: error
|
|
|
|
# (a player's build started from the AppImage itself, with no game, up to where the lifted game is needed: a file the
|
|
# AppImage does not carry fails here, not in every player's build. 2026-11-10: third_party/fonts, #1567. After the upload,
|
|
# so a failing image can be looked at; a tag's release needs this job to pass)
|
|
- name: A player's build from the AppImage
|
|
run: scripts/linux/check_player_build.sh
|
|
|
|
# (a tag's update parts, for the release job: scripts/linux/make_parts.py. Not on other runs: about 240 MB)
|
|
- if: startsWith(github.ref, 'refs/tags/')
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: Hookshot-linux-parts
|
|
path: build-linux/parts/
|
|
if-no-files-found: error
|
|
|
|
release:
|
|
name: Release asset
|
|
if: startsWith(github.ref, 'refs/tags/') && github.ref_name != 'builder-parts' && github.ref_name != 'linux-parts' && vars.CI_RELEASE_LINUX == 'true'
|
|
needs: appimage
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 15
|
|
permissions:
|
|
contents: write
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
GH_REPO: ${{ github.repository }}
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
name: Hookshot-linux-x86_64
|
|
path: dist
|
|
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
name: Hookshot-linux-parts
|
|
path: dist/parts
|
|
# (the parts to the linux-parts release, which is never "latest"; a part already there is not uploaded again)
|
|
- name: Update parts
|
|
run: scripts/linux/publish_parts.sh dist/parts
|
|
# (the release made here or by the Windows builder workflow, whichever is first; a -rc tag is a prerelease and
|
|
# never "latest")
|
|
- name: AppImage to the release
|
|
run: scripts/release_upload.sh "$GITHUB_REF_NAME" dist/*.AppImage dist/parts/triforce-linux.txt
|