@@ -3,6 +3,10 @@ name: GenerateBuilds
33on :
44 push :
55
6+ env :
7+ # Allow actions still pinned to the deprecated Node 16 runtime to keep running.
8+ ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : " true"
9+
610concurrency :
711 group : ${{ github.workflow }}-${{ github.ref }}
812 cancel-in-progress : true
1115 generate-port-o2r :
1216 runs-on : ubuntu-22.04
1317 steps :
14- - uses : actions/checkout@v4
18+ - uses : actions/checkout@v7
1519 with :
1620 submodules : true
21+ fetch-depth : 0 # full history so the libultraship submodule gitlink resolves
1722 - name : Extract Project Version
1823 id : extract_version
1924 run : |
3035 ${{ runner.os }}-o2r-ccache-${{ github.ref }}
3136 ${{ runner.os }}-o2r-ccache-
3237 - name : Cache build folders
33- uses : actions/cache@v5
38+ uses : actions/cache@v6
3439 with :
3540 key : ${{ runner.os }}-o2r-build-${{ github.ref }}-${{ github.sha }}
3641 restore-keys : |
5358 needs : generate-port-o2r
5459 runs-on : windows-2022
5560 steps :
56- - uses : actions/checkout@v4
61+ - uses : actions/checkout@v7
5762 with :
5863 submodules : recursive
64+ fetch-depth : 0 # full history so the libultraship submodule gitlink resolves
5965 - name : Setup MSVC
6066 uses : ilammy/msvc-dev-cmd@v1
6167 - name : Setup Python
@@ -64,35 +70,63 @@ jobs:
6470 python-version : ' 3.12'
6571 - name : Install Python dependencies
6672 run : pip install -r libultraship/requirements.txt
67- - name : Cache vcpkg
68- uses : actions/cache@v4
73+ - name : Cache Vulkan SDK
74+ uses : actions/cache@v6
75+ with :
76+ key : windows-vulkan-sdk-v1
77+ path : C:\VulkanSDK
78+ - name : Install Vulkan SDK
79+ shell : pwsh
80+ run : |
81+ # Skip the (large) download+install when the cache already restored the SDK.
82+ if (-not (Test-Path "C:\VulkanSDK\Lib")) {
83+ $url = "https://sdk.lunarg.com/sdk/download/latest/windows/vulkan_sdk.exe"
84+ Invoke-WebRequest -Uri $url -OutFile "$env:RUNNER_TEMP\vulkan_sdk.exe"
85+ $p = Start-Process -FilePath "$env:RUNNER_TEMP\vulkan_sdk.exe" -ArgumentList "--root","C:\VulkanSDK","--accept-licenses","--default-answer","--confirm-command","install" -Wait -PassThru
86+ if ($p.ExitCode -ne 0) { throw "Vulkan SDK install failed with exit code $($p.ExitCode)" }
87+ }
88+ "VULKAN_SDK=C:\VulkanSDK" | Out-File -FilePath $env:GITHUB_ENV -Append
89+ - name : Cache vcpkg binaries
90+ uses : actions/cache@v6
6991 with :
70- key : ${{ runner.os }}-vcpkg-x64-static- ${{ hashFiles('CMakeLists.txt', 'cmake/automate-vcpkg.cmake') }}
92+ key : windows-vcpkg- ${{ github.ref }}-${{ github.sha }}
7193 restore-keys : |
72- ${{ runner.os }}-vcpkg-x64-static-
94+ windows-vcpkg-${{ github.ref }}
95+ windows-vcpkg-
7396 path : |
74- build/x64/vcpkg
75- build/x64/vcpkg_installed
76- build/x64/vcpkg/downloads
97+ ~\AppData\Local\vcpkg\archives
98+ - name : sccache
99+ uses : hendrikmuhs/ccache-action@v1.2.14
100+ with :
101+ variant : sccache
102+ key : windows-sccache-${{ github.ref }}-${{ github.sha }}
103+ restore-keys : |
104+ windows-sccache-${{ github.ref }}
105+ windows-sccache-
77106 - name : Build
78107 run : |
79- $env:VCPKG_ROOT=""
80- cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=Release -DPython3_EXECUTABLE="$(python -c 'import sys; print(sys.executable)')"
81- cmake --build ./build/x64 --config Release --parallel 10
108+ # Use the runner's preinstalled vcpkg (blanking VCPKG_ROOT made automate-vcpkg
109+ # try to clone into an empty path and fail).
110+ $env:VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT
111+ # Ninja (single-config) so the compiler launcher works; sccache caches MSVC objects.
112+ # msvc-dev-cmd (arch x64) puts cl.exe on PATH; the x64-windows-static triplet is
113+ # set unconditionally in CMakeLists, so dropping -A x64 doesn't change it.
114+ cmake -S . -B "build/x64" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DPython3_EXECUTABLE="$(python -c 'import sys; print(sys.executable)')"
115+ cmake --build ./build/x64 --parallel 10
82116 - name : Download ghostship.o2r
83117 uses : actions/download-artifact@v4
84118 with :
85119 name : ghostship.o2r
86- path : ./build/x64/Release
120+ path : ./build/x64
87121 - name : Create Package
88122 run : |
89123 mkdir debug
90- if (-Not (Test-Path "build/x64/Release/ .tcc")) { Write-Error "ERROR: .tcc not found in build/x64/Release /"; exit 1 }
91- mv build/x64/Release/ .tcc .tcc
92- mv build/x64/Release/ Ghostship.exe .
93- mv build/x64/Release/ tcc.dll .
94- mv build/x64/Release/ ghostship.o2r .
95- mv build/x64/Release/ *.pdb debug/
124+ if (-Not (Test-Path "build/x64/.tcc")) { Write-Error "ERROR: .tcc not found in build/x64/"; exit 1 }
125+ mv build/x64/.tcc .tcc
126+ mv build/x64/Ghostship.exe .
127+ mv build/x64/tcc.dll .
128+ mv build/x64/ghostship.o2r .
129+ mv build/x64/*.pdb debug/
96130 mv README.md readme.txt
97131 Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt" -OutFile "gamecontrollerdb.txt"
98132 - name : Upload build
@@ -115,9 +149,10 @@ jobs:
115149 needs : generate-port-o2r
116150 runs-on : macos-14
117151 steps :
118- - uses : actions/checkout@v4
152+ - uses : actions/checkout@v7
119153 with :
120154 submodules : recursive
155+ fetch-depth : 0 # full history so the libultraship submodule gitlink resolves
121156 - name : Configure ccache
122157 uses : hendrikmuhs/ccache-action@v1.2
123158 with :
@@ -157,11 +192,14 @@ jobs:
157192 - name : Install dependencies
158193 run : |
159194 brew uninstall --ignore-dependencies libpng
160- sudo port install libsdl2 +universal libsdl2_net +universal libpng +universal glew +universal libzip +universal nlohmann-json +universal tinyxml2 +universal libogg +universal libopus +universal opusfile +universal libvorbis +universal mbedtls +universal
195+ sudo port install libsdl2 +universal libsdl2_net +universal libpng +universal glew +universal libzip +universal nlohmann-json +universal tinyxml2 +universal libogg +universal libopus +universal opusfile +universal libvorbis +universal mbedtls +universal vulkan-headers +universal vulkan-loader +universal MoltenVK +universal shaderc +universal
161196 brew install ninja
162197 - name : Build (Universal)
163198 run : |
164199 export PATH="/usr/lib/ccache:/opt/homebrew/opt/ccache/libexec:/usr/local/opt/ccache/libexec:$PATH"
200+ # MacPorts installs the (universal) Vulkan SDK under /opt/local; point the build
201+ # at it so find_package(Vulkan) + shaderc resolve and the Vulkan backend is built.
202+ export VULKAN_SDK=/opt/local
165203 cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DPython3_EXECUTABLE=$(which python3)
166204 cmake --build build-cmake --config Release --parallel 10
167205 - name : Download ghostship.o2r
@@ -196,13 +234,14 @@ jobs:
196234 needs : generate-port-o2r
197235 runs-on : ubuntu-latest
198236 steps :
199- - uses : actions/checkout@v4
237+ - uses : actions/checkout@v7
200238 with :
201239 submodules : recursive
240+ fetch-depth : 0 # full history so the libultraship submodule gitlink resolves
202241 - name : Update machine
203242 run : sudo apt update
204243 - name : Install dependencies
205- run : sudo apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev libogg-dev libvorbis-dev libmbedtls-dev
244+ run : sudo apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev libogg-dev libvorbis-dev libmbedtls-dev libvulkan-dev libshaderc-dev glslang-dev spirv-tools
206245 - name : ccache
207246 uses : hendrikmuhs/ccache-action@v1.2.14
208247 with :
@@ -211,7 +250,7 @@ jobs:
211250 linux-ccache-${{ github.ref }}
212251 linux-ccache-
213252 - name : Cache build folders
214- uses : actions/cache@v5
253+ uses : actions/cache@v6
215254 with :
216255 key : linux-build-${{ github.ref }}-${{ github.sha }}
217256 restore-keys : |
@@ -236,8 +275,10 @@ jobs:
236275 - name : Install latest tinyxml2
237276 run : |
238277 export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
239- wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
240- tar -xzf 10.0.0.tar.gz
278+ if [ ! -d "tinyxml2-10.0.0" ]; then
279+ wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
280+ tar -xzf 10.0.0.tar.gz
281+ fi
241282 cd tinyxml2-10.0.0
242283 mkdir -p build
243284 cd build
@@ -271,7 +312,8 @@ jobs:
271312 path : ./build-cmake
272313 - name : Build
273314 run : |
274- cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPython3_EXECUTABLE=$(which python3)
315+ # Route the compiler through ccache so the linux-ccache cache is actually used.
316+ cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -DPython3_EXECUTABLE=$(which python3)
275317 cmake --build build-cmake --config Release -j3
276318 (cd build-cmake && cpack -G External)
277319 wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt
@@ -298,22 +340,37 @@ jobs:
298340 container :
299341 image : devkitpro/devkita64:20260219
300342 steps :
301- - uses : actions/checkout@v4
343+ - uses : actions/checkout@v7
302344 with :
303345 submodules : recursive
346+ fetch-depth : 0 # full history so the libultraship submodule gitlink resolves
347+ # ccache-action doesn't run cleanly inside the devkitpro container, so cache the
348+ # ccache dir directly (workspace-relative so host and container share it).
349+ - name : Cache ccache
350+ uses : actions/cache@v6
351+ with :
352+ key : switch-ccache-${{ github.ref }}-${{ github.sha }}
353+ restore-keys : |
354+ switch-ccache-${{ github.ref }}
355+ switch-ccache-
356+ path : |
357+ .ccache
304358 - name : Install dependencies
305359 run : |
306360 sudo apt-get update
307- sudo apt-get install -y ninja-build
361+ sudo apt-get install -y ninja-build ccache
308362 sudo apt-get remove -y cmake
309363 sudo dkp-pacman -R --noconfirm switch-tinyxml2 # devkitPro's tinyxml2 is too old and causes build issues
310- export CFLAGS="${CFLAGS} -include strings.h" # weird libzip error (pulled in by LUS) that only happens in CI and not for SoH
364+ export CFLAGS="${CFLAGS} -include strings.h" # weird libzip error (pulled in by LUS) that only happens in CI and not for SoH
311365 git -C libultraship remote add nx https://github.com/Net64DD/libultraship.git
312366 git -C libultraship fetch nx
313367 git -C libultraship checkout nx/main-nx-nightly
314368 wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh -O /tmp/cmake.sh
315369 sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir
316- cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DCMAKE_BUILD_TYPE:STRING=Release
370+ # Route the devkitA64 cross-compiler through ccache; CCACHE_DIR is workspace-relative
371+ # so the cached dir restored on the host is visible inside the container.
372+ export CCACHE_DIR="$GITHUB_WORKSPACE/.ccache"
373+ cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DCMAKE_BUILD_TYPE:STRING=Release -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
317374 cmake --build build-switch --config Release -j3
318375 wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/refs/heads/master/gamecontrollerdb.txt
319376 mv README.md readme.txt
0 commit comments