summaryrefslogtreecommitdiff
path: root/.github/workflows/main.yml
blob: 16a0758d656a238b8d8732a2df0497753cb8bc14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
name: GenerateBuilds

on:
  push:
    branches: ["*"]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  generate-port-o2r:
    runs-on: ubuntu-22.04
    steps:
    - uses: actions/checkout@v4
      with:
        submodules: true
    - name: Install dependencies
      run: sudo apt-get install gcc g++ git cmake ninja-build lsb-release
    - name: ccache
      uses: hendrikmuhs/ccache-action@v1.2.13
      with:
        key: ${{ runner.os }}-o2r-ccache-${{ github.ref }}-${{ github.sha }}
        restore-keys: |
          ${{ runner.os }}-o2r-ccache-${{ github.ref }}
          ${{ runner.os }}-o2r-ccache-
    - name: Cache build folders
      uses: actions/cache@v4
      with:
        key: ${{ runner.os }}-o2r-build-${{ github.ref }}-${{ github.sha }}
        restore-keys: |
          ${{ runner.os }}-o2r-build-${{ github.ref }}
          ${{ runner.os }}-o2r-build-
        path: |
          torch/cmake-build-release
    - name: Generate spaghetti.o2r
      run: |
        export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
        make -C torch type=release -j3
        torch/cmake-build-release/torch pack assets spaghetti.o2r o2r
    - uses: actions/upload-artifact@v4
      with:
        name: spaghetti.o2r
        path: spaghetti.o2r
        retention-days: 1

  build-windows:
    needs: generate-port-o2r
    runs-on: windows-2022
    strategy:
      matrix:
        config: [Release, Debug]
        arch: [x64, Win32]
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          fetch-tags: true
          submodules: recursive
      - name: Build
        run: |
          cmake -S . -B "build/${{ matrix.arch }}" -G "Visual Studio 17 2022" -T v143 -A ${{ matrix.arch }} -DCMAKE_BUILD_TYPE=${{ matrix.config }}
          cmake --build ./build/${{ matrix.arch }} --config ${{ matrix.config }} --parallel 10
      - name: Download spaghetti.o2r
        uses: actions/download-artifact@v4
        with:
          name: spaghetti.o2r
          path: ./build/${{ matrix.arch }}/${{ matrix.config }}
      - name: Create Package
        run: |
          mkdir spaghetti-${{ matrix.config }}
          mv build/${{ matrix.arch }}/${{ matrix.config }}/Spaghettify.exe spaghetti-${{ matrix.config }}/
          mv build/${{ matrix.arch }}/${{ matrix.config }}/spaghetti.o2r spaghetti-${{ matrix.config }}/
          mv config.yml spaghetti-${{ matrix.config }}/
          mv yamls spaghetti-${{ matrix.config }}/
          mv meta 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-${{ matrix.arch }}
          path: spaghetti-${{ matrix.config }}

  build-macos-arm64:
    needs: generate-port-o2r
    runs-on: macOS-latest
    strategy:
      matrix:
        config: [Release, Debug]
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          fetch-tags: true
          submodules: recursive
      - name: Install dependencies
        run: brew install ninja cmake
      - name: Build
        run: |
          cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DENABLE_VCPKG=ON
          cmake --build build-cmake --config ${{ matrix.config }} -j3
      - name: Download spaghetti.o2r
        uses: actions/download-artifact@v4
        with:
          name: spaghetti.o2r
          path: ./build-cmake
      - name: Create Package
        run: |
          APP=build-cmake/SpaghettiKart.app
          # Insert the canonical spaghetti.o2r from the generate-port-o2r job and
          # the controller database, then re-sign since the bundle contents changed.
          cp build-cmake/spaghetti.o2r $APP/Contents/Resources/spaghetti.o2r
          wget -O $APP/Contents/Resources/gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt
          codesign --force --deep --sign - --options runtime --entitlements cmake/macos/entitlements.plist $APP
          mkdir spaghetti-${{ matrix.config }}
          # Zip with ditto so the executable bit survives artifact upload.
          ditto -c -k --keepParent $APP spaghetti-${{ matrix.config }}/SpaghettiKart.app.zip
      - name: Publish packaged artifacts
        if: matrix.config == 'Release'
        uses: actions/upload-artifact@v4
        with:
            name: spaghetti-mac-arm64
            path: spaghetti-${{ matrix.config }}
  
  build-macos-intel:
    needs: generate-port-o2r
    runs-on: macos-15-intel
    strategy:
      matrix:
        config: [Release, Debug]
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          fetch-tags: true
          submodules: recursive
      - name: Install dependencies
        run: brew install ninja cmake
      - name: Build
        run: |
          cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DENABLE_VCPKG=ON
          cmake --build build-cmake --config ${{ matrix.config }} -j3
      - name: Download spaghetti.o2r
        uses: actions/download-artifact@v4
        with:
          name: spaghetti.o2r
          path: ./build-cmake
      - name: Create Package
        run: |
          APP=build-cmake/SpaghettiKart.app
          # Insert the canonical spaghetti.o2r from the generate-port-o2r job and
          # the controller database, then re-sign since the bundle contents changed.
          cp build-cmake/spaghetti.o2r $APP/Contents/Resources/spaghetti.o2r
          wget -O $APP/Contents/Resources/gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt
          codesign --force --deep --sign - --options runtime --entitlements cmake/macos/entitlements.plist $APP
          mkdir spaghetti-${{ matrix.config }}
          # Zip with ditto so the executable bit survives artifact upload.
          ditto -c -k --keepParent $APP spaghetti-${{ matrix.config }}/SpaghettiKart.app.zip
      - name: Publish packaged artifacts
        if: matrix.config == 'Release'
        uses: actions/upload-artifact@v4
        with:
            name: spaghetti-mac-intel-x64
            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:
          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-ccache-${{ github.ref }}-${{ github.sha }}
          restore-keys: |
            linux-ccache-${{ github.ref }}
            linux-ccache-
      - name: Cache build folders
        uses: actions/cache@v4
        with:
          key: linux-build-${{ github.ref }}-${{ github.sha }}
          restore-keys: |
            linux-build-${{ github.ref }}
            linux-build-
          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 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=${{ 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

  build-linux-old:
    needs: generate-port-o2r
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        config: [Release, Debug]
    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=${{ matrix.config }}
          cmake --build build-cmake --config ${{ matrix.config }} -j3

  build-linux-docker:
    needs: generate-port-o2r
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        config: [Release, Debug]
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          fetch-tags: true
          submodules: recursive
      - name: Docker caching
        uses: ScribeMD/docker-cache@0.5.0
        id: cache
        continue-on-error: true
        with:
          key: sk-docker-cache-${{ hashFiles('Dockerfile') }}
      - name: Build docker image
        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=${{ matrix.config }}
      - name: Build spaghetti
        run: docker run --rm -v ${PWD}:/project spaghetti cmake --build build-cmake --config ${{ matrix.config }} -j$(nproc)

  build-linux-release-docker:
    needs: generate-port-o2r
    runs-on: ubuntu-latest
    strategy:
      matrix:
        config: [Release]
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          fetch-tags: true
          submodules: recursive

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Cache Docker layers
        uses: actions/cache@v4
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ hashFiles('script/Dockerfile', 'vcpkg.json') }}
          restore-keys: |
            ${{ runner.os }}-buildx-

      - name: Build Docker image
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ./script/Dockerfile
          push: false
          load: true
          tags: spaghettikart-builder:latest
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

      - name: Build project in Docker
        run: |
          docker run --rm \
            -v "${{ github.workspace }}:/project" \
            spaghettikart-builder:latest \
            bash -c "
              cmake -B build -G Ninja \
                -DCMAKE_BUILD_TYPE=${{ matrix.config }} \
                -DENABLE_VCPKG=ON && \
              cmake --build build --parallel
            "

      - name: Fix permissions
        run: sudo chown -R $(id -u):$(id -g) build

      - name: Download spaghetti.o2r
        uses: actions/download-artifact@v4
        with:
          name: spaghetti.o2r
          path: ./build

      - name: Generate AppImage
        run: |
          docker run --rm \
            -v "${{ github.workspace }}:/project" \
            spaghettikart-builder:latest \
            bash -c "
              cd /project/build && \
              cpack -G External || true
            "

      - name: Create Package
        run: |
          mkdir -p spaghetti-${{ matrix.config }}
          wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt
          mv gamecontrollerdb.txt spaghetti-${{ matrix.config }}/
          cp build/*.appimage spaghetti-${{ matrix.config }}/spaghetti.appimage 2>/dev/null || true

      - name: Publish packaged artifacts
        uses: actions/upload-artifact@v4
        with:
          name: spaghetti-linux-x64
          path: spaghetti-${{ matrix.config }}

      # Workaround for cache growing too large
      - name: Move cache
        run: |
          rm -rf /tmp/.buildx-cache
          mv /tmp/.buildx-cache-new /tmp/.buildx-cache || true

  build-linux-x86-docker:
    needs: generate-port-o2r
    runs-on: ubuntu-latest
    strategy:
      matrix:
        config: [Release]
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          fetch-tags: true
          submodules: recursive
 
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Cache Docker layers
        uses: actions/cache@v4
        with:
          path: /tmp/.buildx-cache-x86
          key: ${{ runner.os }}-buildx-x86-${{ hashFiles('script/Dockerfile.x86', 'vcpkg.json') }}
          restore-keys: |
            ${{ runner.os }}-buildx-x86-

      - name: Build Docker image for x86
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ./script/Dockerfile.x86
          platforms: linux/386
          push: false
          load: true
          tags: spaghettikart-x86:latest
          cache-from: type=local,src=/tmp/.buildx-cache-x86
          cache-to: type=local,dest=/tmp/.buildx-cache-x86-new,mode=max

      - name: Build project in Docker (x86)
        run: |
          docker run --rm --platform linux/386 \
            -v "${{ github.workspace }}:/project" \
            spaghettikart-x86:latest \
            bash -c "
              cmake -B build-x86 -G Ninja \
                -DCMAKE_BUILD_TYPE=${{ matrix.config }} && \
              cmake --build build-x86 --parallel
            "

      - name: Fix permissions
        run: sudo chown -R $(id -u):$(id -g) build-x86

      - name: Download spaghetti.o2r
        uses: actions/download-artifact@v4
        with:
          name: spaghetti.o2r
          path: ./build-x86

      - name: Generate AppImage
        run: |
          docker run --rm --platform linux/386 \
            -v "${{ github.workspace }}:/project" \
            spaghettikart-x86:latest \
            bash -c "
              cd /project/build-x86 && \
              cpack -G External
            "

      - name: Create Package
        run: |
          mkdir -p spaghetti-x86-${{ matrix.config }}
          wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt
          mv gamecontrollerdb.txt spaghetti-x86-${{ matrix.config }}/
          cp build-x86/*.appimage spaghetti-x86-${{ matrix.config }}/spaghetti.appimage

      - name: Publish packaged artifacts
        uses: actions/upload-artifact@v4
        with:
          name: spaghetti-linux-x86
          path: spaghetti-x86-${{ matrix.config }}

      - name: Move cache
        run: |
          rm -rf /tmp/.buildx-cache-x86
          mv /tmp/.buildx-cache-x86-new /tmp/.buildx-cache-x86 || true

  build-switch:
    needs: generate-port-o2r
    runs-on: ubuntu-latest
    strategy:
      matrix:
        config: [Release, Debug]
    container:
      image: devkitpro/devkita64:20251117
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          fetch-tags: true
          submodules: recursive
      - name: Download spaghetti.o2r
        uses: actions/download-artifact@v4
        with:
          name: spaghetti.o2r
          path: .
      - 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=${{ 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
          path: |
            Spaghettify.nro
            spaghetti.o2r