From 62e6dcadbd3800f4c18d0fcc6cbf2d1497e65617 Mon Sep 17 00:00:00 2001 From: Thomas Rohloff Date: Wed, 25 Jun 2025 20:53:18 +0200 Subject: [PATCH 01/13] Correctly split common and arch specific flags Signed-off-by: Thomas Rohloff --- CMakeLists.txt | 112 ++++++++++--------------------------------------- 1 file changed, 23 insertions(+), 89 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 120d049bc..7af763a11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,16 +97,26 @@ endif() ################################################################################ # Global configuration types ################################################################################ -if (CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch") -set(CMAKE_C_FLAGS_DEBUG "-g -ffast-math -DDEBUG") -set(CMAKE_CXX_FLAGS_DEBUG "-g -ffast-math -DDEBUG") -set(CMAKE_C_FLAGS_RELEASE "-O3 -ffast-math -DNDEBUG") -set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ffast-math -DNDEBUG") -else() -set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG") -set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") -set(CMAKE_OBJCXX_FLAGS_RELEASE "-O2 -DNDEBUG") -endif() +set(COMMON_FLAGS "-Wall -Wextra -Wno-error \ + -Wno-return-type \ + -Wno-unused-parameter \ + -Wno-unused-function \ + -Wno-unused-variable \ + -Wno-missing-field-initializers \ + -Wno-parentheses \ + -Wno-narrowing \ + -Wno-missing-braces \ + -Wno-int-conversion \ + -fpermissive \ + -ffast-math" +) +set(COMMON_C_FLAGS "${COMMON_FLAGS} -Werror-implicit-function-declaration -Wno-incompatible-pointer-types") +set(COMMON_CXX_FLAGS "${COMMON_FLAGS} -Wno-c++11-narrowing -Wno-deprecated-enum-enum-conversion") + +set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG ${COMMON_C_FLAGS}") +set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG ${COMMON_CXX_FLAGS}") +set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG ${COMMON_C_FLAGS}") +set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG ${COMMON_CXX_FLAGS}") # Set game compilation version set(VERSION us) @@ -552,26 +562,6 @@ endif() if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS") target_compile_options(${PROJECT_NAME} PRIVATE - -Wall -Wextra -Wno-error - -Wno-return-type - -Wno-unused-parameter - -Wno-unused-function - -Wno-unused-variable - -Wno-missing-field-initializers - -Wno-parentheses - -Wno-narrowing - -Wno-missing-braces - -Wno-int-conversion - $<$: - -Werror-implicit-function-declaration - -Wno-incompatible-pointer-types - -fpermissive - > - $<$:-fpermissive> - $<$: - -Wno-c++11-narrowing - -Wno-deprecated-enum-enum-conversion - > -pthread ) @@ -580,76 +570,20 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") ) elseif (CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch") target_compile_options(${PROJECT_NAME} PRIVATE - -Wall -Wextra -Wno-error - -Wno-return-type - -Wno-unused-parameter - -Wno-unused-function - -Wno-unused-variable - -Wno-missing-field-initializers - -Wno-parentheses - -Wno-narrowing - -Wno-missing-braces - -Wno-int-conversion - $<$: - -Werror-implicit-function-declaration - -Wno-incompatible-pointer-types - -fpermissive - > - $<$:-fpermissive> - $<$: - -Wno-c++11-narrowing - -Wno-deprecated-enum-enum-conversion - > -pthread ) target_link_options(${PROJECT_NAME} PRIVATE -pthread ) - elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS") - target_compile_options(${PROJECT_NAME} PRIVATE - -O2 - - # disable some warnings to not clutter output - -Wno-multichar - -Wno-return-type - -Wno-narrowing - -Wno-switch-outside-range - $<$: - -Werror-implicit-function-declaration - -Wno-incompatible-pointer-types - -Wno-discarded-array-qualifiers - -Wno-discarded-qualifiers - -Wno-int-conversion - -Wno-builtin-declaration-mismatch - -Wno-switch-unreachable - -Wno-stringop-overflow - > - ) - else() + elseif (NOT CMAKE_SYSTEM_NAME STREQUAL "CafeOS") if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - set(CPU_OPTION -msse2 -mfpmath=sse) + set(CPU_OPTION -msse2 -mfpmath=sse) endif() target_compile_options(${PROJECT_NAME} PRIVATE - -Wall -Wextra -Wno-error - -Wno-unused-parameter - -Wno-unused-function - -Wno-unused-variable - -Wno-missing-field-initializers - -Wno-parentheses - -Wno-narrowing - -Wno-missing-braces - -Wno-int-conversion - $<$: - -Werror-implicit-function-declaration - -Wno-incompatible-pointer-types - -fpermissive - > - $<$:-fpermissive> - $<$:-Wno-deprecated-enum-enum-conversion> -pthread - ${CPU_OPTION} + ${CPU_OPTION} ) target_link_options(${PROJECT_NAME} PRIVATE From e008ad678600d44a1000813e20a11172138d628c Mon Sep 17 00:00:00 2001 From: Thomas Rohloff Date: Wed, 25 Jun 2025 20:55:26 +0200 Subject: [PATCH 02/13] Add -pipe to FLAGS Signed-off-by: Thomas Rohloff --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7af763a11..7fbfd83a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,8 @@ set(COMMON_FLAGS "-Wall -Wextra -Wno-error \ -Wno-missing-braces \ -Wno-int-conversion \ -fpermissive \ - -ffast-math" + -ffast-math \ + -pipe" ) set(COMMON_C_FLAGS "${COMMON_FLAGS} -Werror-implicit-function-declaration -Wno-incompatible-pointer-types") set(COMMON_CXX_FLAGS "${COMMON_FLAGS} -Wno-c++11-narrowing -Wno-deprecated-enum-enum-conversion") From 08f0592f1780492580ff69c6f2b006c5692dbd31 Mon Sep 17 00:00:00 2001 From: Thomas Rohloff Date: Thu, 26 Jun 2025 11:12:45 +0200 Subject: [PATCH 03/13] Try to fix MSVC build Signed-off-by: Thomas Rohloff --- CMakeLists.txt | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fbfd83a3..d4af33b6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,26 +94,38 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") endif() endif() +################################################################################ +# Compiler specific configuration types +################################################################################ +if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang") + set(COMMON_FLAGS "-Wall -Wextra -Wno-error \ + -Wno-return-type \ + -Wno-unused-parameter \ + -Wno-unused-function \ + -Wno-unused-variable \ + -Wno-missing-field-initializers \ + -Wno-parentheses \ + -Wno-narrowing \ + -Wno-missing-braces \ + -fpermissive \ + -ffast-math \ + -pipe" + ) + + set(COMMON_C_FLAGS "${COMMON_FLAGS} -Wno-int-conversion -Werror-implicit-function-declaration -Wno-incompatible-pointer-types") + set(COMMON_CXX_FLAGS "${COMMON_FLAGS} -Wno-c++11-narrowing -Wno-deprecated-enum-enum-conversion") +elseif (MSVC) + set(COMMON_FLAGS "/fp:fast") + set(COMMON_C_FLAGS "${COMMON_FLAGS}") + set(COMMON_CXX_FLAGS "${COMMON_FLAGS}") +else() + set(COMMON_C_FLAGS "") + set(COMMON_CXX_FLAGS "") +endif() + ################################################################################ # Global configuration types ################################################################################ -set(COMMON_FLAGS "-Wall -Wextra -Wno-error \ - -Wno-return-type \ - -Wno-unused-parameter \ - -Wno-unused-function \ - -Wno-unused-variable \ - -Wno-missing-field-initializers \ - -Wno-parentheses \ - -Wno-narrowing \ - -Wno-missing-braces \ - -Wno-int-conversion \ - -fpermissive \ - -ffast-math \ - -pipe" -) -set(COMMON_C_FLAGS "${COMMON_FLAGS} -Werror-implicit-function-declaration -Wno-incompatible-pointer-types") -set(COMMON_CXX_FLAGS "${COMMON_FLAGS} -Wno-c++11-narrowing -Wno-deprecated-enum-enum-conversion") - set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG ${COMMON_C_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG ${COMMON_CXX_FLAGS}") set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG ${COMMON_C_FLAGS}") From dea55cf8c7b9026e6fb77a60151f66ba49153901 Mon Sep 17 00:00:00 2001 From: Thomas Rohloff Date: Sat, 28 Jun 2025 10:59:29 +0200 Subject: [PATCH 04/13] Move -fpermissive to CXX flags To silence a compiler warning about unrecognized command-line options while compiling C files Signed-off-by: Thomas Rohloff --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4af33b6c..48b0955d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,13 +107,12 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang") -Wno-parentheses \ -Wno-narrowing \ -Wno-missing-braces \ - -fpermissive \ -ffast-math \ -pipe" ) set(COMMON_C_FLAGS "${COMMON_FLAGS} -Wno-int-conversion -Werror-implicit-function-declaration -Wno-incompatible-pointer-types") - set(COMMON_CXX_FLAGS "${COMMON_FLAGS} -Wno-c++11-narrowing -Wno-deprecated-enum-enum-conversion") + set(COMMON_CXX_FLAGS "${COMMON_FLAGS} -Wno-c++11-narrowing -Wno-deprecated-enum-enum-conversion -fpermissive") elseif (MSVC) set(COMMON_FLAGS "/fp:fast") set(COMMON_C_FLAGS "${COMMON_FLAGS}") From dc918a936b1874f2850893cbe3de8db4be79e7a3 Mon Sep 17 00:00:00 2001 From: Thomas Rohloff Date: Sat, 28 Jun 2025 11:01:09 +0200 Subject: [PATCH 05/13] Add -fomit-frame-pointer to CXX flags Signed-off-by: Thomas Rohloff --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48b0955d7..d076c5e28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,7 +112,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang") ) set(COMMON_C_FLAGS "${COMMON_FLAGS} -Wno-int-conversion -Werror-implicit-function-declaration -Wno-incompatible-pointer-types") - set(COMMON_CXX_FLAGS "${COMMON_FLAGS} -Wno-c++11-narrowing -Wno-deprecated-enum-enum-conversion -fpermissive") + set(COMMON_CXX_FLAGS "${COMMON_FLAGS} -Wno-c++11-narrowing -Wno-deprecated-enum-enum-conversion -fpermissive -fomit-frame-pointer") elseif (MSVC) set(COMMON_FLAGS "/fp:fast") set(COMMON_C_FLAGS "${COMMON_FLAGS}") From a3801d4a01fda8f9a0801b9eb17919e6fd92c590 Mon Sep 17 00:00:00 2001 From: Thomas Rohloff Date: Fri, 18 Jul 2025 11:58:42 +0200 Subject: [PATCH 06/13] Enable link-time optimization LTO should help optimizing spaghetti code better. This caused a lot of crashes in the past but looks stable with the latest code fixes in master, so I think it's time to enable it. Signed-off-by: Thomas Rohloff --- CMakeLists.txt | 1 + doxygen-awesome-css | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d076c5e28..751c5e778 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,6 +108,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang") -Wno-narrowing \ -Wno-missing-braces \ -ffast-math \ + -flto=auto \ -pipe" ) diff --git a/doxygen-awesome-css b/doxygen-awesome-css index 28ed396de..9760c3001 160000 --- a/doxygen-awesome-css +++ b/doxygen-awesome-css @@ -1 +1 @@ -Subproject commit 28ed396de19cd3d803bcb483dceefdb6d03b1b2b +Subproject commit 9760c30014131f4eacb8e96f15f3869c7bc5dd8c From 20cba1b5c2f249865790ed891fcbf99da668cabe Mon Sep 17 00:00:00 2001 From: Thomas Rohloff Date: Sat, 19 Jul 2025 12:49:17 +0200 Subject: [PATCH 07/13] Don't enable obsolete and broken debugging in debug builds Signed-off-by: Thomas Rohloff --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1534a03f6..88b475807 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,8 +153,8 @@ endif() ################################################################################ # Global configuration types ################################################################################ -set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG ${COMMON_C_FLAGS}") -set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG ${COMMON_CXX_FLAGS}") +set(CMAKE_C_FLAGS_DEBUG "-g -DNDEBUG ${COMMON_C_FLAGS}") +set(CMAKE_CXX_FLAGS_DEBUG "-g -DNDEBUG ${COMMON_CXX_FLAGS}") set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG ${COMMON_C_FLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG ${COMMON_CXX_FLAGS}") From 425d6cdffb5383390bfff80da197937bde6225a0 Mon Sep 17 00:00:00 2001 From: Thomas Rohloff Date: Sat, 19 Jul 2025 13:01:27 +0200 Subject: [PATCH 08/13] Add debug workflows Signed-off-by: Thomas Rohloff --- .github/workflows/linux-compile-debug.yml | 53 +++++ .github/workflows/linux-compile.yml | 2 +- .github/workflows/macos-compile-debug.yml | 35 ++++ .github/workflows/macos-compile.yml | 2 +- .github/workflows/main.yml | 220 +++++++++++++++++++- .github/workflows/windows-compile-debug.yml | 25 +++ .github/workflows/windows-compile.yml | 2 +- 7 files changed, 335 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/linux-compile-debug.yml create mode 100644 .github/workflows/macos-compile-debug.yml create mode 100644 .github/workflows/windows-compile-debug.yml diff --git a/.github/workflows/linux-compile-debug.yml b/.github/workflows/linux-compile-debug.yml new file mode 100644 index 000000000..aa03b557e --- /dev/null +++ b/.github/workflows/linux-compile-debug.yml @@ -0,0 +1,53 @@ +name: Linux Validation + +on: + pull_request: + branches: [ "*" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + submodules: recursive + - name: Update machine + run: sudo apt update + - name: Install dependencies + 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 + - name: Install latest SDL + run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + wget https://www.libsdl.org/release/SDL2-2.24.1.tar.gz + tar -xzf SDL2-2.24.1.tar.gz + cd SDL2-2.24.1 + ./configure + make -j 10 + sudo make install + - name: Install latest tinyxml2 + run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz + tar -xzf 10.0.0.tar.gz + cd tinyxml2-10.0.0 + mkdir -p build + cd build + cmake .. + make + sudo make install + - name: Build + run: | + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Debug + cmake --build build-cmake -j --config Debug + - name: Create Package + run: | + mkdir spaghetti-release + mv build-cmake/Spaghettify spaghetti-release/ + - name: Publish packaged artifacts + uses: actions/upload-artifact@v4 + with: + name: spaghetti-linux-x64 + path: spaghetti-release + retention-days: 1 diff --git a/.github/workflows/linux-compile.yml b/.github/workflows/linux-compile.yml index fb5019d94..305085d56 100644 --- a/.github/workflows/linux-compile.yml +++ b/.github/workflows/linux-compile.yml @@ -40,7 +40,7 @@ jobs: - name: Build run: | cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release - cmake --build build-cmake -j + cmake --build build-cmake -j --config Release - name: Create Package run: | mkdir spaghetti-release diff --git a/.github/workflows/macos-compile-debug.yml b/.github/workflows/macos-compile-debug.yml new file mode 100644 index 000000000..80c3f13d9 --- /dev/null +++ b/.github/workflows/macos-compile-debug.yml @@ -0,0 +1,35 @@ +name: MacOS Validation + +on: + pull_request: + branches: [ "*" ] + +jobs: + build: + runs-on: macOS-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + submodules: recursive + - name: Install dependencies + run: brew install ninja cmake + - name: Install vcpkg + uses: lukka/run-vcpkg@v11.5 + with: + vcpkgDirectory: '${{ github.workspace }}/vcpkg' + - name: Build + run: | + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + cmake --build build-cmake -j --config Debug + - name: Create Package + run: | + mkdir spaghetti-release + mv build-cmake/Spaghettify spaghetti-release/ + - name: Publish packaged artifacts + uses: actions/upload-artifact@v4 + with: + name: spaghetti-mac-universal + path: spaghetti-release + retention-days: 1 diff --git a/.github/workflows/macos-compile.yml b/.github/workflows/macos-compile.yml index 870579d6a..b1a41283d 100644 --- a/.github/workflows/macos-compile.yml +++ b/.github/workflows/macos-compile.yml @@ -22,7 +22,7 @@ jobs: - name: Build run: | cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - cmake --build build-cmake -j + cmake --build build-cmake -j --config Release - name: Create Package run: | mkdir spaghetti-release diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d99628b39..696ee5a3f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -76,6 +76,38 @@ jobs: name: spaghetti-windows path: spaghetti-release + build-windows-debug: + needs: generate-port-o2r + runs-on: windows-2022 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + submodules: recursive + - name: Build + run: | + cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=Debug + cmake --build ./build/x64 --config Debug --parallel 10 + - name: Download spaghetti.o2r + uses: actions/download-artifact@v4 + with: + name: spaghetti.o2r + path: ./build/x64/Release + - name: Create Package + run: | + mkdir spaghetti-release + mv build/x64/Release/Spaghettify.exe spaghetti-release/ + mv build/x64/Release/spaghetti.o2r spaghetti-release/ + mv config.yml spaghetti-release/ + mv yamls spaghetti-release/ + Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt" -OutFile "spaghetti-release/gamecontrollerdb.txt" + - name: Upload build + uses: actions/upload-artifact@v4 + with: + name: spaghetti-windows + path: spaghetti-release + build-macos: needs: generate-port-o2r runs-on: macOS-latest @@ -114,6 +146,44 @@ jobs: name: spaghetti-mac-x64 path: spaghetti-release + build-macos-debug: + needs: generate-port-o2r + runs-on: macOS-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + submodules: recursive + - name: Install dependencies + run: brew install ninja cmake + - name: Install vcpkg + uses: lukka/run-vcpkg@v11.5 + with: + vcpkgDirectory: '${{ github.workspace }}/vcpkg' + - name: Build + run: | + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + cmake --build build-cmake --config Debug -j3 + - name: Download spaghetti.o2r + uses: actions/download-artifact@v4 + with: + name: spaghetti.o2r + path: ./build-cmake + - name: Create Package + run: | + mkdir spaghetti-release + mv build-cmake/Spaghettify spaghetti-release/ + mv build-cmake/spaghetti.o2r spaghetti-release/ + mv config.yml spaghetti-release/ + mv yamls spaghetti-release/ + wget -O spaghetti-release/gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt + - name: Publish packaged artifacts + uses: actions/upload-artifact@v4 + with: + name: spaghetti-mac-x64 + path: spaghetti-release + build-linux: needs: generate-port-o2r runs-on: ubuntu-latest @@ -308,6 +378,109 @@ jobs: yamls gamecontrollerdb.txt + build-linux-old-debug: + needs: generate-port-o2r + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + submodules: recursive + - name: Update machine + run: sudo apt update + - name: Install dependencies + run: sudo apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libsdl2-net-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 + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.14 + with: + key: linux-old-ccache-${{ github.ref }}-${{ github.sha }} + restore-keys: | + linux-old-ccache-${{ github.ref }} + linux-old-ccache- + - name: Cache build folders + uses: actions/cache@v4 + with: + key: linux-old-build-${{ github.ref }}-${{ github.sha }} + restore-keys: | + linux-build-old-${{ github.ref }} + linux-build-old- + path: | + SDL2-2.30.3 + tinyxml2-10.0.0 + libzip-1.10.1 + - name: Install latest SDL + run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + if [ ! -d "SDL2-2.30.3" ]; then + wget https://www.libsdl.org/release/SDL2-2.30.3.tar.gz + tar -xzf SDL2-2.30.3.tar.gz + fi + cd SDL2-2.30.3 + ./configure --enable-hidapi-libusb + make -j 10 + sudo make install + sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ + - name: Install latest SDL_net + run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + if [ ! -d "SDL2_net-2.2.0" ]; then + wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz + tar -xzf SDL2_net-2.2.0.tar.gz + fi + cd SDL2_net-2.2.0 + ./configure + make -j 10 + sudo make install + sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ + - name: Install latest tinyxml2 + run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz + tar -xzf 10.0.0.tar.gz + cd tinyxml2-10.0.0 + mkdir -p build + cd build + cmake .. + make + sudo make install + - name: Install libzip without crypto + run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + if [ ! -d "libzip-1.10.1" ]; then + wget https://github.com/nih-at/libzip/releases/download/v1.10.1/libzip-1.10.1.tar.gz + tar -xzf libzip-1.10.1.tar.gz + fi + cd libzip-1.10.1 + mkdir -p build + cd build + cmake .. -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF + make + sudo make install + sudo cp -av /usr/local/lib/libzip* /lib/x86_64-linux-gnu/ + - name: Download spaghetti.o2r + uses: actions/download-artifact@v4 + with: + name: spaghetti.o2r + path: ./build-cmake + - name: Build + run: | + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Debug + cmake --build build-cmake --config Debug -j3 + (cd build-cmake && cpack -G External) + wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt + mv README.md readme.txt + mv build-cmake/*.appimage spaghetti.appimage + - name: Upload build + uses: actions/upload-artifact@v4 + with: + name: Spaghettify-linux + path: | + spaghetti.appimage + config.yml + yamls + gamecontrollerdb.txt + build-linux-docker: needs: generate-port-o2r runs-on: ubuntu-22.04 @@ -361,7 +534,7 @@ jobs: make sudo make install cd ../.. - cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake + # cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DCMAKE_BUILD_TYPE=Release cmake --build build-switch --config Release -j3 wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt mv README.md readme.txt @@ -375,3 +548,48 @@ jobs: config.yml assets gamecontrollerdb.txt + + build-switch-debug: + needs: generate-port-o2r + runs-on: ubuntu-latest + container: + image: devkitpro/devkita64:20241023 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + submodules: recursive + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y ninja-build + sudo apt-get remove -y cmake + git -C libultraship remote add nx https://github.com/Net64DD/libultraship.git + git -C libultraship fetch nx + git -C libultraship checkout nx/main-nx + wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh -O /tmp/cmake.sh + sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir + wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz + tar -xzf 10.0.0.tar.gz + cd tinyxml2-10.0.0 + mkdir build + cd build + cmake -H.. -B. -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake + make + sudo make install + cd ../.. + cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DCMAKE_BUILD_TYPE=Debug + cmake --build build-switch --config Debug -j3 + wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt + mv README.md readme.txt + mv build-switch/*.nro Spaghettify.nro + - name: Upload build + uses: actions/upload-artifact@v4 + with: + name: Spaghettify-switch + path: | + Spaghettify.nro + config.yml + assets + gamecontrollerdb.txt diff --git a/.github/workflows/windows-compile-debug.yml b/.github/workflows/windows-compile-debug.yml new file mode 100644 index 000000000..361ee083e --- /dev/null +++ b/.github/workflows/windows-compile-debug.yml @@ -0,0 +1,25 @@ +name: Windows Validation + +on: + pull_request: + branches: [ "*" ] + +jobs: + build: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + submodules: recursive + - name: Build + run: | + cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=Debug + cmake --build ./build/x64 --config Debug --parallel 10 + - name: Upload build + uses: actions/upload-artifact@v4 + with: + name: spaghetti-windows + path: ./build/x64/Debug + retention-days: 1 diff --git a/.github/workflows/windows-compile.yml b/.github/workflows/windows-compile.yml index bbaee328b..e1352dbbc 100644 --- a/.github/workflows/windows-compile.yml +++ b/.github/workflows/windows-compile.yml @@ -16,7 +16,7 @@ jobs: - name: Build run: | cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=Release - cmake --build ./build/x64 + cmake --build ./build/x64 --config Release --parallel 10 - name: Upload build uses: actions/upload-artifact@v4 with: From 859835a162e3728d5fad4e1234785837984f3cb7 Mon Sep 17 00:00:00 2001 From: Thomas Rohloff Date: Sat, 19 Jul 2025 13:08:19 +0200 Subject: [PATCH 09/13] Rename PR workflows Signed-off-by: Thomas Rohloff --- .github/workflows/linux-compile-debug.yml | 2 +- .github/workflows/linux-compile.yml | 2 +- .github/workflows/macos-compile-debug.yml | 2 +- .github/workflows/macos-compile.yml | 2 +- .github/workflows/windows-compile-debug.yml | 2 +- .github/workflows/windows-compile.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux-compile-debug.yml b/.github/workflows/linux-compile-debug.yml index aa03b557e..426804841 100644 --- a/.github/workflows/linux-compile-debug.yml +++ b/.github/workflows/linux-compile-debug.yml @@ -1,4 +1,4 @@ -name: Linux Validation +name: Linux Validation (Debug) on: pull_request: diff --git a/.github/workflows/linux-compile.yml b/.github/workflows/linux-compile.yml index 305085d56..1f54cefbd 100644 --- a/.github/workflows/linux-compile.yml +++ b/.github/workflows/linux-compile.yml @@ -1,4 +1,4 @@ -name: Linux Validation +name: Linux Validation (Release) on: pull_request: diff --git a/.github/workflows/macos-compile-debug.yml b/.github/workflows/macos-compile-debug.yml index 80c3f13d9..ee029a982 100644 --- a/.github/workflows/macos-compile-debug.yml +++ b/.github/workflows/macos-compile-debug.yml @@ -1,4 +1,4 @@ -name: MacOS Validation +name: MacOS Validation (Debug) on: pull_request: diff --git a/.github/workflows/macos-compile.yml b/.github/workflows/macos-compile.yml index b1a41283d..858aab36c 100644 --- a/.github/workflows/macos-compile.yml +++ b/.github/workflows/macos-compile.yml @@ -1,4 +1,4 @@ -name: MacOS Validation +name: MacOS Validation (Release) on: pull_request: diff --git a/.github/workflows/windows-compile-debug.yml b/.github/workflows/windows-compile-debug.yml index 361ee083e..1ba9c1181 100644 --- a/.github/workflows/windows-compile-debug.yml +++ b/.github/workflows/windows-compile-debug.yml @@ -1,4 +1,4 @@ -name: Windows Validation +name: Windows Validation (Debug) on: pull_request: diff --git a/.github/workflows/windows-compile.yml b/.github/workflows/windows-compile.yml index e1352dbbc..e2d23c092 100644 --- a/.github/workflows/windows-compile.yml +++ b/.github/workflows/windows-compile.yml @@ -1,4 +1,4 @@ -name: Windows Validation +name: Windows Validation (Release) on: pull_request: From 73a7938046e22b76c51da36f13b5f46c82555cd0 Mon Sep 17 00:00:00 2001 From: coco875 <59367621+coco875@users.noreply.github.com> Date: Sat, 19 Jul 2025 14:10:51 +0200 Subject: [PATCH 10/13] use matrix instead --- .github/workflows/linux-compile-debug.yml | 53 --------------------- .github/workflows/linux-compile.yml | 15 +++--- .github/workflows/macos-compile-debug.yml | 35 -------------- .github/workflows/macos-compile.yml | 17 ++++--- .github/workflows/windows-compile-debug.yml | 25 ---------- .github/workflows/windows-compile.yml | 13 +++-- 6 files changed, 27 insertions(+), 131 deletions(-) delete mode 100644 .github/workflows/linux-compile-debug.yml delete mode 100644 .github/workflows/macos-compile-debug.yml delete mode 100644 .github/workflows/windows-compile-debug.yml diff --git a/.github/workflows/linux-compile-debug.yml b/.github/workflows/linux-compile-debug.yml deleted file mode 100644 index 426804841..000000000 --- a/.github/workflows/linux-compile-debug.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Linux Validation (Debug) - -on: - pull_request: - branches: [ "*" ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - submodules: recursive - - name: Update machine - run: sudo apt update - - name: Install dependencies - 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 - - name: Install latest SDL - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - wget https://www.libsdl.org/release/SDL2-2.24.1.tar.gz - tar -xzf SDL2-2.24.1.tar.gz - cd SDL2-2.24.1 - ./configure - make -j 10 - sudo make install - - name: Install latest tinyxml2 - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz - tar -xzf 10.0.0.tar.gz - cd tinyxml2-10.0.0 - mkdir -p build - cd build - cmake .. - make - sudo make install - - name: Build - run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Debug - cmake --build build-cmake -j --config Debug - - name: Create Package - run: | - mkdir spaghetti-release - mv build-cmake/Spaghettify spaghetti-release/ - - name: Publish packaged artifacts - uses: actions/upload-artifact@v4 - with: - name: spaghetti-linux-x64 - path: spaghetti-release - retention-days: 1 diff --git a/.github/workflows/linux-compile.yml b/.github/workflows/linux-compile.yml index 1f54cefbd..def053633 100644 --- a/.github/workflows/linux-compile.yml +++ b/.github/workflows/linux-compile.yml @@ -7,6 +7,9 @@ on: jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + config: [Release, Debug] steps: - uses: actions/checkout@v4 with: @@ -39,15 +42,15 @@ jobs: sudo make install - name: Build run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release - cmake --build build-cmake -j --config Release + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config }} + cmake --build build-cmake -j --config ${{ matrix.config }} - name: Create Package run: | - mkdir spaghetti-release - mv build-cmake/Spaghettify spaghetti-release/ + mkdir spaghetti-${{ matrix.config }} + mv build-cmake/Spaghettify spaghetti-${{ matrix.config }}/ - name: Publish packaged artifacts uses: actions/upload-artifact@v4 with: - name: spaghetti-linux-x64 - path: spaghetti-release + name: spaghetti-linux-x64-${{ matrix.config }} + path: spaghetti-${{ matrix.config }} retention-days: 1 diff --git a/.github/workflows/macos-compile-debug.yml b/.github/workflows/macos-compile-debug.yml deleted file mode 100644 index ee029a982..000000000 --- a/.github/workflows/macos-compile-debug.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: MacOS Validation (Debug) - -on: - pull_request: - branches: [ "*" ] - -jobs: - build: - runs-on: macOS-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - submodules: recursive - - name: Install dependencies - run: brew install ninja cmake - - name: Install vcpkg - uses: lukka/run-vcpkg@v11.5 - with: - vcpkgDirectory: '${{ github.workspace }}/vcpkg' - - name: Build - run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - cmake --build build-cmake -j --config Debug - - name: Create Package - run: | - mkdir spaghetti-release - mv build-cmake/Spaghettify spaghetti-release/ - - name: Publish packaged artifacts - uses: actions/upload-artifact@v4 - with: - name: spaghetti-mac-universal - path: spaghetti-release - retention-days: 1 diff --git a/.github/workflows/macos-compile.yml b/.github/workflows/macos-compile.yml index 858aab36c..ec72d0b57 100644 --- a/.github/workflows/macos-compile.yml +++ b/.github/workflows/macos-compile.yml @@ -1,4 +1,4 @@ -name: MacOS Validation (Release) +name: MacOS Validation on: pull_request: @@ -7,6 +7,9 @@ on: jobs: build: runs-on: macOS-latest + strategy: + matrix: + config: [Release, Debug] steps: - uses: actions/checkout@v4 with: @@ -21,15 +24,15 @@ jobs: vcpkgDirectory: '${{ github.workspace }}/vcpkg' - name: Build run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - cmake --build build-cmake -j --config Release + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + cmake --build build-cmake -j --config ${{ matrix.config }} - name: Create Package run: | - mkdir spaghetti-release - mv build-cmake/Spaghettify spaghetti-release/ + mkdir spaghetti-${{ matrix.config }} + mv build-cmake/Spaghettify spaghetti-${{ matrix.config }}/ - name: Publish packaged artifacts uses: actions/upload-artifact@v4 with: - name: spaghetti-mac-universal - path: spaghetti-release + name: spaghetti-mac-universal-${{ matrix.config }} + path: spaghetti-${{ matrix.config }} retention-days: 1 diff --git a/.github/workflows/windows-compile-debug.yml b/.github/workflows/windows-compile-debug.yml deleted file mode 100644 index 1ba9c1181..000000000 --- a/.github/workflows/windows-compile-debug.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Windows Validation (Debug) - -on: - pull_request: - branches: [ "*" ] - -jobs: - build: - runs-on: windows-2022 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - submodules: recursive - - name: Build - run: | - cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=Debug - cmake --build ./build/x64 --config Debug --parallel 10 - - name: Upload build - uses: actions/upload-artifact@v4 - with: - name: spaghetti-windows - path: ./build/x64/Debug - retention-days: 1 diff --git a/.github/workflows/windows-compile.yml b/.github/workflows/windows-compile.yml index e2d23c092..42258ec9c 100644 --- a/.github/workflows/windows-compile.yml +++ b/.github/workflows/windows-compile.yml @@ -1,4 +1,4 @@ -name: Windows Validation (Release) +name: Windows Validation on: pull_request: @@ -7,6 +7,9 @@ on: jobs: build: runs-on: windows-2022 + strategy: + matrix: + config: [Release, Debug] steps: - uses: actions/checkout@v4 with: @@ -15,11 +18,11 @@ jobs: submodules: recursive - name: Build run: | - cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=Release - cmake --build ./build/x64 --config Release --parallel 10 + cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=${{ matrix.config }} + cmake --build ./build/x64 --config ${{ matrix.config }} --parallel 10 - name: Upload build uses: actions/upload-artifact@v4 with: - name: spaghetti-windows - path: ./build/x64/Debug + name: spaghetti-windows-${{ matrix.config }} + path: ./build/x64/${{ matrix.config }} retention-days: 1 From dfd4b823a20574e889bb5ff7ab0ba18a9072532b Mon Sep 17 00:00:00 2001 From: coco875 <59367621+coco875@users.noreply.github.com> Date: Sat, 19 Jul 2025 14:15:57 +0200 Subject: [PATCH 11/13] Update linux-compile.yml --- .github/workflows/linux-compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-compile.yml b/.github/workflows/linux-compile.yml index def053633..7f0fe1a5f 100644 --- a/.github/workflows/linux-compile.yml +++ b/.github/workflows/linux-compile.yml @@ -1,4 +1,4 @@ -name: Linux Validation (Release) +name: Linux Validation on: pull_request: From dac4247f4ab2986b411786eb455cd7fc696eaf19 Mon Sep 17 00:00:00 2001 From: coco875 <59367621+coco875@users.noreply.github.com> Date: Sat, 19 Jul 2025 14:32:00 +0200 Subject: [PATCH 12/13] more matrix --- .github/workflows/main.yml | 305 ++++++------------------------------- 1 file changed, 50 insertions(+), 255 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 696ee5a3f..beaf692d3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,6 +47,9 @@ jobs: build-windows: needs: generate-port-o2r runs-on: windows-2022 + strategy: + matrix: + config: [Release, Debug] steps: - uses: actions/checkout@v4 with: @@ -55,62 +58,34 @@ jobs: submodules: recursive - name: Build run: | - cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=Release - cmake --build ./build/x64 --config Release --parallel 10 + cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=${{ matrix.config }} + cmake --build ./build/x64 --config ${{ matrix.config }} --parallel 10 - name: Download spaghetti.o2r uses: actions/download-artifact@v4 with: name: spaghetti.o2r - path: ./build/x64/Release + path: ./build/x64/${{ matrix.config }} - name: Create Package run: | - mkdir spaghetti-release - mv build/x64/Release/Spaghettify.exe spaghetti-release/ - mv build/x64/Release/spaghetti.o2r spaghetti-release/ - mv config.yml spaghetti-release/ - mv yamls spaghetti-release/ - Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt" -OutFile "spaghetti-release/gamecontrollerdb.txt" + mkdir spaghetti-${{ matrix.config }} + mv build/x64/${{ matrix.config }}/Spaghettify.exe spaghetti-${{ matrix.config }}/ + mv build/x64/${{ matrix.config }}/spaghetti.o2r spaghetti-${{ matrix.config }}/ + mv config.yml spaghetti-${{ matrix.config }}/ + mv yamls spaghetti-${{ matrix.config }}/ + Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt" -OutFile "spaghetti-${{ matrix.config }}/gamecontrollerdb.txt" - name: Upload build + if: matrix.config == 'Release' uses: actions/upload-artifact@v4 with: name: spaghetti-windows - path: spaghetti-release - - build-windows-debug: - needs: generate-port-o2r - runs-on: windows-2022 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - submodules: recursive - - name: Build - run: | - cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=Debug - cmake --build ./build/x64 --config Debug --parallel 10 - - name: Download spaghetti.o2r - uses: actions/download-artifact@v4 - with: - name: spaghetti.o2r - path: ./build/x64/Release - - name: Create Package - run: | - mkdir spaghetti-release - mv build/x64/Release/Spaghettify.exe spaghetti-release/ - mv build/x64/Release/spaghetti.o2r spaghetti-release/ - mv config.yml spaghetti-release/ - mv yamls spaghetti-release/ - Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt" -OutFile "spaghetti-release/gamecontrollerdb.txt" - - name: Upload build - uses: actions/upload-artifact@v4 - with: - name: spaghetti-windows - path: spaghetti-release + path: spaghetti-${{ matrix.config }} build-macos: needs: generate-port-o2r runs-on: macOS-latest + strategy: + matrix: + config: [Release, Debug] steps: - uses: actions/checkout@v4 with: @@ -125,8 +100,8 @@ jobs: vcpkgDirectory: '${{ github.workspace }}/vcpkg' - name: Build run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - cmake --build build-cmake --config Release -j3 + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + cmake --build build-cmake --config ${{ matrix.config }} -j3 - name: Download spaghetti.o2r uses: actions/download-artifact@v4 with: @@ -134,59 +109,25 @@ jobs: path: ./build-cmake - name: Create Package run: | - mkdir spaghetti-release - mv build-cmake/Spaghettify spaghetti-release/ - mv build-cmake/spaghetti.o2r spaghetti-release/ - mv config.yml spaghetti-release/ - mv yamls spaghetti-release/ - wget -O spaghetti-release/gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt + mkdir spaghetti-${{ matrix.config }} + mv build-cmake/Spaghettify spaghetti-${{ matrix.config }}/ + mv build-cmake/spaghetti.o2r spaghetti-${{ matrix.config }}/ + mv config.yml spaghetti-${{ matrix.config }}/ + mv yamls spaghetti-${{ matrix.config }}/ + wget -O spaghetti-${{ matrix.config }}/gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt - name: Publish packaged artifacts + if: matrix.config == 'Release' uses: actions/upload-artifact@v4 with: name: spaghetti-mac-x64 - path: spaghetti-release - - build-macos-debug: - needs: generate-port-o2r - runs-on: macOS-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - submodules: recursive - - name: Install dependencies - run: brew install ninja cmake - - name: Install vcpkg - uses: lukka/run-vcpkg@v11.5 - with: - vcpkgDirectory: '${{ github.workspace }}/vcpkg' - - name: Build - run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - cmake --build build-cmake --config Debug -j3 - - name: Download spaghetti.o2r - uses: actions/download-artifact@v4 - with: - name: spaghetti.o2r - path: ./build-cmake - - name: Create Package - run: | - mkdir spaghetti-release - mv build-cmake/Spaghettify spaghetti-release/ - mv build-cmake/spaghetti.o2r spaghetti-release/ - mv config.yml spaghetti-release/ - mv yamls spaghetti-release/ - wget -O spaghetti-release/gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt - - name: Publish packaged artifacts - uses: actions/upload-artifact@v4 - with: - name: spaghetti-mac-x64 - path: spaghetti-release + path: spaghetti-${{ matrix.config }} build-linux: needs: generate-port-o2r runs-on: ubuntu-latest + strategy: + matrix: + config: [Release, Debug] steps: - uses: actions/checkout@v4 with: @@ -259,25 +200,19 @@ jobs: path: ./build-cmake - name: Build run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release - cmake --build build-cmake --config Release -j3 + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config }} + cmake --build build-cmake --config ${{ matrix.config }} -j3 (cd build-cmake && cpack -G External) wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt mv README.md readme.txt mv build-cmake/*.appimage spaghetti.appimage - # - name: Upload build - # uses: actions/upload-artifact@v4 - # with: - # name: Spaghettify-linux - # path: | - # spaghetti.appimage - # config.yml - # yamls - # gamecontrollerdb.txt build-linux-old: needs: generate-port-o2r runs-on: ubuntu-22.04 + strategy: + matrix: + config: [Release, Debug] steps: - uses: actions/checkout@v4 with: @@ -362,119 +297,17 @@ jobs: path: ./build-cmake - name: Build run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release - cmake --build build-cmake --config Release -j3 + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config }} + cmake --build build-cmake --config ${{ matrix.config }} -j3 (cd build-cmake && cpack -G External) wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt mv README.md readme.txt mv build-cmake/*.appimage spaghetti.appimage - name: Upload build + if: matrix.config == 'Release' uses: actions/upload-artifact@v4 with: - name: Spaghettify-linux - path: | - spaghetti.appimage - config.yml - yamls - gamecontrollerdb.txt - - build-linux-old-debug: - needs: generate-port-o2r - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - submodules: recursive - - name: Update machine - run: sudo apt update - - name: Install dependencies - run: sudo apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libsdl2-net-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 - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2.14 - with: - key: linux-old-ccache-${{ github.ref }}-${{ github.sha }} - restore-keys: | - linux-old-ccache-${{ github.ref }} - linux-old-ccache- - - name: Cache build folders - uses: actions/cache@v4 - with: - key: linux-old-build-${{ github.ref }}-${{ github.sha }} - restore-keys: | - linux-build-old-${{ github.ref }} - linux-build-old- - path: | - SDL2-2.30.3 - tinyxml2-10.0.0 - libzip-1.10.1 - - name: Install latest SDL - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - if [ ! -d "SDL2-2.30.3" ]; then - wget https://www.libsdl.org/release/SDL2-2.30.3.tar.gz - tar -xzf SDL2-2.30.3.tar.gz - fi - cd SDL2-2.30.3 - ./configure --enable-hidapi-libusb - make -j 10 - sudo make install - sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ - - name: Install latest SDL_net - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - if [ ! -d "SDL2_net-2.2.0" ]; then - wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz - tar -xzf SDL2_net-2.2.0.tar.gz - fi - cd SDL2_net-2.2.0 - ./configure - make -j 10 - sudo make install - sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ - - name: Install latest tinyxml2 - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz - tar -xzf 10.0.0.tar.gz - cd tinyxml2-10.0.0 - mkdir -p build - cd build - cmake .. - make - sudo make install - - name: Install libzip without crypto - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - if [ ! -d "libzip-1.10.1" ]; then - wget https://github.com/nih-at/libzip/releases/download/v1.10.1/libzip-1.10.1.tar.gz - tar -xzf libzip-1.10.1.tar.gz - fi - cd libzip-1.10.1 - mkdir -p build - cd build - cmake .. -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF - make - sudo make install - sudo cp -av /usr/local/lib/libzip* /lib/x86_64-linux-gnu/ - - name: Download spaghetti.o2r - uses: actions/download-artifact@v4 - with: - name: spaghetti.o2r - path: ./build-cmake - - name: Build - run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Debug - cmake --build build-cmake --config Debug -j3 - (cd build-cmake && cpack -G External) - wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt - mv README.md readme.txt - mv build-cmake/*.appimage spaghetti.appimage - - name: Upload build - uses: actions/upload-artifact@v4 - with: - name: Spaghettify-linux + name: spaghetti-linux-x64 path: | spaghetti.appimage config.yml @@ -484,6 +317,9 @@ jobs: build-linux-docker: needs: generate-port-o2r runs-on: ubuntu-22.04 + strategy: + matrix: + config: [Release, Debug] steps: - uses: actions/checkout@v4 with: @@ -500,13 +336,16 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: docker build . -t spaghetti - name: Confiure - run: docker run --rm -v ${PWD}:/project spaghetti cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release + run: docker run --rm -v ${PWD}:/project spaghetti cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config }} - name: Build spaghetti - run: docker run --rm -v ${PWD}:/project spaghetti cmake --build build-cmake --config Release -j$(nproc) + run: docker run --rm -v ${PWD}:/project spaghetti cmake --build build-cmake --config ${{ matrix.config }} -j$(nproc) build-switch: needs: generate-port-o2r runs-on: ubuntu-latest + strategy: + matrix: + config: [Release, Debug] container: image: devkitpro/devkita64:20241023 steps: @@ -534,57 +373,13 @@ jobs: make sudo make install cd ../.. - # cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DCMAKE_BUILD_TYPE=Release - cmake --build build-switch --config Release -j3 - wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt - mv README.md readme.txt - mv build-switch/*.nro Spaghettify.nro - - name: Upload build - uses: actions/upload-artifact@v4 - with: - name: Spaghettify-switch - path: | - Spaghettify.nro - config.yml - assets - gamecontrollerdb.txt - - build-switch-debug: - needs: generate-port-o2r - runs-on: ubuntu-latest - container: - image: devkitpro/devkita64:20241023 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - submodules: recursive - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y ninja-build - sudo apt-get remove -y cmake - git -C libultraship remote add nx https://github.com/Net64DD/libultraship.git - git -C libultraship fetch nx - git -C libultraship checkout nx/main-nx - wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh -O /tmp/cmake.sh - sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir - wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz - tar -xzf 10.0.0.tar.gz - cd tinyxml2-10.0.0 - mkdir build - cd build - cmake -H.. -B. -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake - make - sudo make install - cd ../.. - cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DCMAKE_BUILD_TYPE=Debug - cmake --build build-switch --config Debug -j3 + # cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} + cmake --build build-switch --config ${{ matrix.config }} -j3 wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt mv README.md readme.txt mv build-switch/*.nro Spaghettify.nro - name: Upload build + if: matrix.config == 'Release' uses: actions/upload-artifact@v4 with: name: Spaghettify-switch From 93a7894fa7f1fe794d00c813142dace9dfad9172 Mon Sep 17 00:00:00 2001 From: coco875 <59367621+coco875@users.noreply.github.com> Date: Sat, 19 Jul 2025 14:36:19 +0200 Subject: [PATCH 13/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 067d1b8e7..7d0addec5 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ If you want to manually compile SpaghettiKart, please consult the [building inst If you want to playtest a continuous integration build, you can find them at the links below. Keep in mind that these are for playtesting only, and you will likely encounter bugs and possibly crashes. * [Windows](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/spaghetti-windows.zip?status=completed) -* [Linux](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/Spaghettify-linux.zip?status=completed) +* [Linux](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/spaghetti-linux-x64.zip?status=completed) * [macOS](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/spaghetti-mac-x64.zip?status=completed) * [Switch](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/Spaghettify-switch.zip?status=completed)