From e6dfa35cfa43e563a48ec19a94516616d0a0774b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=BCrrenberger?= Date: Tue, 13 Jan 2026 09:53:11 +0100 Subject: [PATCH] Update GitHub Action images and actions --- .github/workflows/ci.yml | 24 +++---- .github/workflows/nuget.yml | 132 ++++++++++++++++++---------------- .github/workflows/release.yml | 38 +++++----- tools/nuget/build.linux.sh | 22 +++++- 4 files changed, 121 insertions(+), 95 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db94f00..543b44e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,9 @@ jobs: - { name: Windows VS2022 x64, os: windows-2025, flags: -Ax64 } - { name: Windows ClangCL, os: windows-2025, flags: -T ClangCL } - { name: Windows Clang, os: windows-2025, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } - - { name: Linux GCC, os: ubuntu-22.04, flags: -GNinja } - - { name: Linux Clang, os: ubuntu-22.04, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } - - { name: MacOS, os: macos-14, flags: -GNinja } + - { name: Linux GCC, os: ubuntu-24.04, flags: -GNinja } + - { name: Linux Clang, os: ubuntu-24.04, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } + - { name: MacOS, os: macos-15, flags: -GNinja } config: - { name: Shared, flags: -DBUILD_SHARED_LIBS=ON, csfml_flags: -DCSFML_LINK_SFML_STATICALLY=OFF } - { name: Static, flags: -DBUILD_SHARED_LIBS=OFF, csfml_flags: -DCSFML_LINK_SFML_STATICALLY=ON } @@ -48,7 +48,7 @@ jobs: run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libxi-dev libudev-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libfreetype-dev - name: Checkout SFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: repository: SFML/SFML ref: ${{env.SFML_VERSION}} @@ -66,7 +66,7 @@ jobs: run: cmake --build SFML/build --config ${{matrix.type.name}} --target install - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML @@ -96,7 +96,7 @@ jobs: run: sudo apt-get install clang-format-17 - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Format Code run: cmake -DCLANG_FORMAT_EXECUTABLE=clang-format-17 -P cmake/Format.cmake @@ -106,7 +106,7 @@ jobs: tidy: name: Analyze - runs-on: macos-14 + runs-on: macos-15 steps: - name: Get CMake and Ninja @@ -122,7 +122,7 @@ jobs: echo /opt/homebrew/opt/llvm/bin >> $GITHUB_PATH - name: Checkout SFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: repository: SFML/SFML ref: ${{env.SFML_VERSION}} @@ -135,7 +135,7 @@ jobs: run: cmake --build SFML/build --target install - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML @@ -147,7 +147,7 @@ jobs: docs: name: Documentation - runs-on: macos-14 + runs-on: macos-15 steps: - name: Get CMake and Ninja @@ -162,7 +162,7 @@ jobs: brew install doxygen ninja || true - name: Checkout SFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: repository: SFML/SFML ref: ${{env.SFML_VERSION}} @@ -175,7 +175,7 @@ jobs: run: cmake --build SFML/build --target install - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index ed84458..2d8c83d 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -17,13 +17,13 @@ env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 jobs: - windows: - name: Windows VS2022 + windows-x86-x64: + name: Windows x86 x64 runs-on: windows-2025 steps: - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML @@ -39,6 +39,22 @@ jobs: cd CSFML/tools/nuget ./build.win.ps1 "win-x64" + - name: Upload Artifact + uses: actions/upload-artifact@v6 + with: + name: CSFML-win-x86-x64 + path: CSFML/tools/nuget/CSFML/runtimes + + windows-arm64: + name: Windows ARM64 + runs-on: windows-11-arm + + steps: + - name: Checkout CSFML + uses: actions/checkout@v6 + with: + path: CSFML + - name: Build ARM64 shell: pwsh run: | @@ -46,20 +62,20 @@ jobs: ./build.win.ps1 "win-arm64" - name: Upload Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: - name: CSFML-win-x86-x64-arm64 + name: CSFML-win-arm64 path: CSFML/tools/nuget/CSFML/runtimes linux-x64: name: Linux x64 - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 container: - image: ubuntu:22.04 + image: ubuntu:24.04 steps: - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML @@ -71,84 +87,77 @@ jobs: ./docker.linux-x64.sh - name: Upload Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: CSFML-linux-x64 path: CSFML/tools/nuget/CSFML/runtimes linux-arm: name: Linux ARM - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04-arm steps: - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML - - name: Build in an ARM container - uses: uraimo/run-on-arch-action@v3.0.1 - with: - arch: armv7 - distro: ubuntu22.04 - githubToken: ${{ github.token }} - dockerRunArgs: | - --volume "${PWD}/CSFML:/CSFML" - install: | - apt-get update -y - apt-get install -y git libfreetype6-dev xorg-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libgl1-mesa-dev libflac-dev libogg-dev libvorbis-dev cmake g++ - run: | - cd /CSFML/tools/nuget - chmod +x ./build.linux.sh - ./build.linux.sh linux-arm + - name: Install dependencies & cross compiler + run: | + sudo dpkg --add-architecture armhf + sudo apt-get update + sudo apt-get install -y git libfreetype6-dev:armhf xorg-dev libxrandr-dev:armhf libxcursor-dev:armhf libxi-dev:armhf libudev-dev:armhf libgl1-mesa-dev:armhf libflac-dev:armhf libogg-dev:armhf libvorbis-dev:armhf cmake g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf + + - name: Build + shell: bash + run: | + cd ./CSFML/tools/nuget + chmod +x ./build.linux.sh + ./build.linux.sh linux-arm arm-linux-gnueabihf-g++ arm-linux-gnueabihf-gcc - name: Upload Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: CSFML-linux-arm path: CSFML/tools/nuget/CSFML/runtimes linux-arm64: name: Linux ARM64 - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04-arm steps: - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML - - name: Build in an ARM64 container - uses: uraimo/run-on-arch-action@v3.0.1 - with: - arch: aarch64 - distro: ubuntu22.04 - githubToken: ${{ github.token }} - dockerRunArgs: | - --volume "${PWD}/CSFML:/CSFML" - install: | - apt-get update -y - apt-get install -y git libfreetype6-dev xorg-dev libxrandr-dev libxcursor-dev libudev-dev libgl1-mesa-dev libflac-dev libogg-dev libvorbis-dev cmake g++ - run: | - cd /CSFML/tools/nuget - chmod +x ./build.linux.sh - ./build.linux.sh linux-arm64 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y git libfreetype6-dev xorg-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libgl1-mesa-dev libflac-dev libogg-dev libvorbis-dev cmake gcc g++ + + - name: Build + shell: bash + run: | + cd ./CSFML/tools/nuget + chmod +x ./build.linux.sh + ./build.linux.sh linux-arm64 - name: Upload Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: CSFML-linux-arm64 path: CSFML/tools/nuget/CSFML/runtimes linux-musl-x64: name: Linux MUSL x64 - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 container: image: alpine:3.20.7 steps: - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML @@ -160,18 +169,18 @@ jobs: ./docker.linux-musl-x64.sh - name: Upload Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: CSFML-linux-musl-x64 path: CSFML/tools/nuget/CSFML/runtimes - macos: - name: macOS - runs-on: macos-14 + macos-x64-arm64: + name: macOS x64 and ARM64 + runs-on: macos-15 steps: - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML @@ -189,7 +198,7 @@ jobs: ./build.macos.sh "osx-arm64" - name: Upload Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: CSFML-macOS-x64-arm64 path: CSFML/tools/nuget/CSFML/runtimes @@ -198,27 +207,28 @@ jobs: name: Package Builds runs-on: ubuntu-24.04 needs: - - windows + - windows-x86-x64 + - windows-arm64 - linux-x64 - linux-arm - linux-arm64 - linux-musl-x64 - - macos + - macos-x64-arm64 steps: - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML - name: Download Artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v7 with: path: CSFML/tools/nuget/CSFML/runtimes merge-multiple: true - - name: Setup .NET 8 SDK + - name: Setup .NET 10 SDK id: setup-dotnet - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: - dotnet-version: 8.0.x + dotnet-version: 10.0.x - name: Enforce SDK Version run: dotnet new globaljson --sdk-version ${{ steps.setup-dotnet.outputs.dotnet-version }} --force - name: Verify SDK Installation @@ -228,7 +238,7 @@ jobs: cd CSFML/tools/nuget dotnet build --configuration Release --verbosity detailed - name: Upload NuGet Package - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: CSFML-NuGet-Package path: CSFML/tools/nuget/CSFML/bin/Release/*.nupkg diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 523e378..2ff2440 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Cache MinGW x86 id: mingw-x86-cache - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ${{ github.workspace }}/mingw32 key: 15.2.0posix-13.0.0-ucrt-r1-x86 @@ -41,14 +41,14 @@ jobs: add_to_path: false - name: Checkout SFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: repository: SFML/SFML ref: ${{ env.SFML_VERSION }} path: SFML - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML @@ -99,7 +99,7 @@ jobs: Move-Item -Path "CSFML-install\*" -Destination "install\CSFML" - name: Upload Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: CSFML-windows-32-bit path: install/CSFML @@ -111,7 +111,7 @@ jobs: steps: - name: Cache MinGW x64 id: mingw-x64-cache - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ${{ github.workspace }}/mingw64 key: 15.2.0posix-13.0.0-ucrt-r1-x64 @@ -128,14 +128,14 @@ jobs: add_to_path: false - name: Checkout SFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: repository: SFML/SFML ref: ${{ env.SFML_VERSION }} path: SFML - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML @@ -186,7 +186,7 @@ jobs: Move-Item -Path "CSFML-install\*" -Destination "install\CSFML" - name: Upload Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: CSFML-windows-64-bit path: install/CSFML @@ -197,14 +197,14 @@ jobs: steps: - name: Checkout SFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: repository: SFML/SFML ref: ${{ env.SFML_VERSION }} path: SFML - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML @@ -225,25 +225,25 @@ jobs: Move-Item -Path "CSFML-install\*" -Destination "install\CSFML" - name: Upload Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: CSFML-windows-arm64 path: install/CSFML macos-x64: name: macOS x64 - runs-on: macos-13 + runs-on: macos-15 steps: - name: Checkout SFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: repository: SFML/SFML ref: ${{ env.SFML_VERSION }} path: SFML - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML @@ -288,25 +288,25 @@ jobs: tar -zcvf CSFML-macOS-clang-64-bit.tar.gz CSFML-macOS-clang-64-bit - name: Upload Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: CSFML-macOS-clang-64-bit path: CSFML-macOS-clang-64-bit.tar.gz macos-arm64: name: macOS ARM64 - runs-on: macos-14 + runs-on: macos-15 steps: - name: Checkout SFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: repository: SFML/SFML ref: ${{ env.SFML_VERSION }} path: SFML - name: Checkout CSFML - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: CSFML - name: Build SFML @@ -350,7 +350,7 @@ jobs: tar -zcvf CSFML-macOS-clang-arm64.tar.gz CSFML-macOS-clang-arm64 - name: Upload Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: CSFML-macOS-clang-arm64 path: CSFML-macOS-clang-arm64.tar.gz diff --git a/tools/nuget/build.linux.sh b/tools/nuget/build.linux.sh index 843decf..2506de0 100755 --- a/tools/nuget/build.linux.sh +++ b/tools/nuget/build.linux.sh @@ -34,13 +34,29 @@ set -e # =================================================== # if [[ -z "$1" ]]; then - echo "Please specify the platform Runtime Identifier as an argument to this script" + echo "Usage: $0 [ ]" + echo "Example: $0 linux-arm arm-linux-gnueabihf-g++ arm-linux-gnueabihf-gcc" exit 1 fi echo "Please note that all SFML dependencies must be installed and available to cmake. SFML does not ship with its linux dependencies." RID="$1" +CXX_COMPILER="$2" +C_COMPILER="$3" + +if [[ -n "$CXX_COMPILER" || -n "$C_COMPILER" ]]; then + if [[ -z "$CXX_COMPILER" || -z "$C_COMPILER" ]]; then + echo "When overriding compilers, specify both C++ and C compilers." + exit 1 + fi +fi + +CMAKE_COMPILER_ARGS=() +if [[ -n "$CXX_COMPILER" ]]; then + CMAKE_COMPILER_ARGS+=("-DCMAKE_CXX_COMPILER=$CXX_COMPILER" "-DCMAKE_C_COMPILER=$C_COMPILER") + echo "Using custom compilers: CXX=$CXX_COMPILER, CC=$C_COMPILER" +fi SFMLBranch="3.0.2" # The branch or tag of the SFML repository to be cloned CSFMLDir="$(realpath ../../)" # The directory of the source code of CSFML @@ -87,7 +103,7 @@ mkdir -p lib SFMLLibDir="$(realpath lib)" cmake -E env LDFLAGS="-z origin" \ - cmake \ + cmake "${CMAKE_COMPILER_ARGS[@]}" \ '-DBUILD_SHARED_LIBS=ON' \ '-DCMAKE_BUILD_TYPE=Release' \ "-DCMAKE_INSTALL_PREFIX=$SFMLLibDir" \ @@ -114,7 +130,7 @@ mkdir -p lib CSFMLLibDir="$(realpath lib)" # The directory that contains the final CSFML libraries. Used to copy the result into SFML.Net cmake -E env LDFLAGS="-z origin" \ - cmake \ + cmake "${CMAKE_COMPILER_ARGS[@]}" \ "-DSFML_ROOT=$SFMLLibDir" \ '-DBUILD_SHARED_LIBS=ON' \ '-DCMAKE_BUILD_TYPE=Release' \