From 865a5ae636ec9ca18de8fba91cc7337be1fe6757 Mon Sep 17 00:00:00 2001 From: Jeod <47716344+JeodC@users.noreply.github.com> Date: Sun, 2 Aug 2026 14:24:49 -0400 Subject: [PATCH] Modify workflows to upload artifacts from pull requests Mirror soh a bit --- .github/workflows/linux.yml | 48 ----------------------------------- .github/workflows/mac.yml | 23 ----------------- .github/workflows/main.yml | 37 ++++++++++++++------------- .github/workflows/switch.yml | 38 --------------------------- .github/workflows/windows.yml | 20 --------------- 5 files changed, 20 insertions(+), 146 deletions(-) delete mode 100644 .github/workflows/linux.yml delete mode 100644 .github/workflows/mac.yml delete mode 100644 .github/workflows/switch.yml delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index dfac3075b..000000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Linux Validation -on: [pull_request] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - 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=Release - cmake --build build-cmake -j - - name: Create Package - run: | - mkdir Lighthouse-release - mv build-cmake/Lighthouse Lighthouse-release/ - - name: Publish packaged artifacts - uses: actions/upload-artifact@v4 - with: - name: Lighthouse-linux-x64 - path: Lighthouse-release - retention-days: 1 diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml deleted file mode 100644 index 569dcca20..000000000 --- a/.github/workflows/mac.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: MacOS Validation - -on: - pull_request: - branches: [ "*" ] - -jobs: - build: - runs-on: macos-14 - steps: - - uses: actions/checkout@v6 - with: - submodules: recursive - - uses: melusina-org/setup-macports@v1 - with: - parameters: '.github/macports.yml' - - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: macos # ccache-macos - - name: Build - run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" - cmake --build build-cmake -j \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f0e90668..f9d670ee5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,7 @@ name: GenerateBuilds on: push: + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -8,9 +9,11 @@ concurrency: jobs: generate-port-o2r: + # Same-repo branches fire both push and pull_request; only build once. + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: submodules: true - name: Extract Project Version @@ -22,7 +25,7 @@ jobs: - 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 + uses: hendrikmuhs/ccache-action@v1.2.23 with: key: ${{ runner.os }}-o2r-ccache-${{ github.ref }}-${{ github.sha }} restore-keys: | @@ -43,7 +46,7 @@ jobs: make -C Torch type=release -j3 cp -r ./libultraship/src/fast/shaders ./port Torch/cmake-build-release/torch pack port lighthouse.o2r o2r -u ${{ steps.extract_version.outputs.version }} - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: lighthouse.o2r path: lighthouse.o2r @@ -53,15 +56,15 @@ jobs: needs: generate-port-o2r runs-on: windows-2022 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: submodules: recursive - name: Build run: | - cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=Release + cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 cmake --build ./build/x64 --config Release --parallel 10 - name: Download lighthouse.o2r - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: lighthouse.o2r path: ./build/x64 @@ -77,7 +80,7 @@ jobs: mv assets lighthouse-release/ Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt" -OutFile "lighthouse-release/gamecontrollerdb.txt" - name: Upload build - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: Lighthouse-windows path: lighthouse-release @@ -86,13 +89,13 @@ jobs: needs: generate-port-o2r runs-on: macos-14 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: submodules: recursive - uses: melusina-org/setup-macports@v1 with: parameters: '.github/macports.yml' - - uses: hendrikmuhs/ccache-action@v1.2 + - uses: hendrikmuhs/ccache-action@v1.2.23 with: key: macos # ccache-macos - name: Build @@ -100,7 +103,7 @@ jobs: cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" cmake --build build-cmake -j - name: Download lighthouse.o2r - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: lighthouse.o2r path: ./build-cmake @@ -110,7 +113,7 @@ jobs: mv _packages/*.dmg Lighthouse.dmg mv README.md readme.txt - name: Publish packaged artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: Lighthouse-mac path: | @@ -121,7 +124,7 @@ jobs: needs: generate-port-o2r runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: submodules: recursive - name: Update machine @@ -129,7 +132,7 @@ jobs: - 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: ccache - uses: hendrikmuhs/ccache-action@v1.2.14 + uses: hendrikmuhs/ccache-action@v1.2.23 with: key: linux-ccache-${{ github.ref }}-${{ github.sha }} restore-keys: | @@ -184,7 +187,7 @@ jobs: sudo make install sudo cp -av /usr/local/lib/libzip* /lib/x86_64-linux-gnu/ - name: Download lighthouse.o2r - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: lighthouse.o2r path: ./build-cmake @@ -197,7 +200,7 @@ jobs: mv README.md readme.txt mv build-cmake/*.appimage lighthouse.appimage - name: Upload build - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: Lighthouse-linux path: | @@ -212,7 +215,7 @@ jobs: container: image: devkitpro/devkita64:20241023 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: submodules: recursive - name: Install dependencies @@ -231,7 +234,7 @@ jobs: mv README.md readme.txt mv build-switch/*.nro Lighthouse.nro - name: Upload build - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: Lighthouse-switch path: | diff --git a/.github/workflows/switch.yml b/.github/workflows/switch.yml deleted file mode 100644 index db9773c5c..000000000 --- a/.github/workflows/switch.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Switch Validation -on: [pull_request] - -jobs: - build-switch: - if: false - runs-on: ubuntu-latest - container: - image: devkitpro/devkita64:20241023 - steps: - - uses: actions/checkout@v4 - with: - 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/YoshiCrystal9/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 - cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake - cmake --build build-switch --config Release -j3 - wget -O gamecontrollerdb.txt https://github.com/mdqinc/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt - mv README.md readme.txt - mv build-switch/*.nro Lighthouse.nro - - name: Upload build - uses: actions/upload-artifact@v4 - with: - name: Lighthouse-switch - retention-days: 1 - path: | - Lighthouse.nro - config.yml - assets - gamecontrollerdb.txt \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index a0f8ae5e1..000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Windows Validation -on: [pull_request] - -jobs: - build: - runs-on: windows-2022 - steps: - - uses: actions/checkout@v4 - with: - 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 - - name: Upload build - uses: actions/upload-artifact@v4 - with: - name: lighthouse-windows - path: ./build/x64/Debug - retention-days: 1 \ No newline at end of file