From ca21a9295c263d07aa3a70153b967e0d73412428 Mon Sep 17 00:00:00 2001 From: Graham Pentheny Date: Sat, 7 Feb 2026 23:55:18 -0500 Subject: [PATCH] Update github workflow to de-dupe SDL installation steps for Windows and Linux as well as macOS Also update to SDL 2.32.10, the last SDL2 version --- .github/actions/setup-sdl2-linux/action.yaml | 11 ++++++ .github/actions/setup-sdl2-macos/action.yaml | 2 +- .../actions/setup-sdl2-windows/action.yaml | 14 ++++++++ .github/workflows/Build.yaml | 36 ++++++++----------- .github/workflows/Tests.yaml | 27 +++++--------- 5 files changed, 49 insertions(+), 41 deletions(-) create mode 100644 .github/actions/setup-sdl2-linux/action.yaml create mode 100644 .github/actions/setup-sdl2-windows/action.yaml diff --git a/.github/actions/setup-sdl2-linux/action.yaml b/.github/actions/setup-sdl2-linux/action.yaml new file mode 100644 index 00000000..378b9b78 --- /dev/null +++ b/.github/actions/setup-sdl2-linux/action.yaml @@ -0,0 +1,11 @@ +name: 'Setup SDL2 on Linux' +description: 'Installs SDL2 and OpenGL development libraries for Linux builds' + +runs: + using: 'composite' + steps: + - name: Install SDL2 and OpenGL + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev libsdl2-dev diff --git a/.github/actions/setup-sdl2-macos/action.yaml b/.github/actions/setup-sdl2-macos/action.yaml index d951a47b..ea9971ee 100644 --- a/.github/actions/setup-sdl2-macos/action.yaml +++ b/.github/actions/setup-sdl2-macos/action.yaml @@ -7,7 +7,7 @@ runs: - name: Download & install SDL shell: bash run: | - curl -L -o SDL2.dmg https://github.com/libsdl-org/SDL/releases/download/release-2.24.2/SDL2-2.24.2.dmg + curl -L -o SDL2.dmg https://github.com/libsdl-org/SDL/releases/download/release-2.32.10/SDL2-2.32.10.dmg hdiutil attach SDL2.dmg cp -r /Volumes/SDL2/SDL2.framework ${{github.workspace}}/RecastDemo/Bin/SDL2.framework hdiutil detach /Volumes/SDL2 diff --git a/.github/actions/setup-sdl2-windows/action.yaml b/.github/actions/setup-sdl2-windows/action.yaml new file mode 100644 index 00000000..6c831efb --- /dev/null +++ b/.github/actions/setup-sdl2-windows/action.yaml @@ -0,0 +1,14 @@ +name: 'Setup SDL2 on Windows' +description: 'Downloads and installs SDL2 development libraries for Windows builds' + +runs: + using: 'composite' + steps: + - name: Download & install SDL2 + shell: pwsh + run: | + $sdlZip = "${{github.workspace}}/RecastDemo/Contrib/SDL.zip" + (New-Object System.Net.WebClient).DownloadFile("https://github.com/libsdl-org/SDL/releases/download/release-2.32.10/SDL2-devel-2.32.10-VC.zip", $sdlZip) + Expand-Archive -Path $sdlZip -DestinationPath "${{github.workspace}}/RecastDemo/Contrib" + Rename-Item -Path "${{github.workspace}}/RecastDemo/Contrib/SDL2-2.32.10" -NewName "SDL" + Remove-Item $sdlZip diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 3a16d91c..9d70b443 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -74,10 +74,12 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install opengl and SDL + - name: Setup SDL2 + uses: ./.github/actions/setup-sdl2-linux + + - name: Install clang run: | - sudo apt-get update - sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev libsdl2-dev clang + sudo apt-get install -y clang clang --version - name: Download & Install premake @@ -107,10 +109,12 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install opengl and SDL + - name: Setup SDL2 + uses: ./.github/actions/setup-sdl2-linux + + - name: Install clang run: | - sudo apt-get update - sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev libsdl2-dev clang + sudo apt-get install -y clang clang --version - name: Configure CMake @@ -141,14 +145,8 @@ jobs: with: vs-version: ${{matrix.version-range}} - - name: Download and Install SDL - working-directory: RecastDemo/Contrib - shell: pwsh - run: | - (new-object System.Net.WebClient).DownloadFile("https://github.com/libsdl-org/SDL/releases/download/release-2.24.2/SDL2-devel-2.24.2-VC.zip","${{github.workspace}}/RecastDemo/Contrib/SDL.zip") - tar -xf SDL.zip - ren SDL2-2.24.2 SDL - del SDL.zip + - name: Setup SDL2 + uses: ./.github/actions/setup-sdl2-windows - name: Download and Install Premake working-directory: RecastDemo @@ -183,14 +181,8 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Download and Install SDL - working-directory: RecastDemo/Contrib - shell: pwsh - run: | - (new-object System.Net.WebClient).DownloadFile("https://github.com/libsdl-org/SDL/releases/download/release-2.24.2/SDL2-devel-2.24.2-VC.zip","${{github.workspace}}/RecastDemo/Contrib/SDL.zip") - tar -xf SDL.zip - ren SDL2-2.24.2 SDL - del SDL.zip + - name: Setup SDL2 + uses: ./.github/actions/setup-sdl2-windows - name: Configure CMake run: cmake -G "${{matrix.cmake-generator}}" -B ${{github.workspace}}/build -D CMAKE_BUILD_TYPE=${{matrix.conf}} -D CMAKE_INSTALL_PREFIX=${{github.workspace}}/build diff --git a/.github/workflows/Tests.yaml b/.github/workflows/Tests.yaml index 681c8eab..cc239fd9 100644 --- a/.github/workflows/Tests.yaml +++ b/.github/workflows/Tests.yaml @@ -13,13 +13,8 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Download & install SDL - run: | - curl -L -o SDL2.dmg https://github.com/libsdl-org/SDL/releases/download/release-2.24.2/SDL2-2.24.2.dmg - hdiutil attach SDL2.dmg - cp -r /Volumes/SDL2/SDL2.framework RecastDemo/Bin - hdiutil detach /Volumes/SDL2 - rm SDL2.dmg + - name: Setup SDL2 + uses: ./.github/actions/setup-sdl2-macos - name: Download & install premake working-directory: RecastDemo @@ -46,10 +41,12 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install opengl and SDL + - name: Setup SDL2 + uses: ./.github/actions/setup-sdl2-linux + + - name: Install clang run: | - sudo apt-get update - sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev libsdl2-dev clang + sudo apt-get install -y clang clang --version - name: Download & Install premake @@ -80,14 +77,8 @@ jobs: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 - - name: Download and Install SDL - working-directory: RecastDemo/Contrib - shell: pwsh - run: | - (new-object System.Net.WebClient).DownloadFile("https://github.com/libsdl-org/SDL/releases/download/release-2.24.2/SDL2-devel-2.24.2-VC.zip","${{github.workspace}}/RecastDemo/Contrib/SDL.zip") - tar -xf SDL.zip - ren SDL2-2.24.2 SDL - del SDL.zip + - name: Setup SDL2 + uses: ./.github/actions/setup-sdl2-windows - name: Download and Install Premake working-directory: RecastDemo