name: Build Native on: workflow_dispatch: inputs: {} # schedule: # - cron: '0 0 * * *' env: BUILD_TYPE: Release jobs: build: name: ${{ matrix.platform.name }} runs-on: ${{ matrix.platform.os }} strategy: fail-fast: false matrix: platform: - { name: win-x64, os: windows-latest, flags: -A x64 } - { name: win-x86, os: windows-latest, flags: -A Win32 } - { name: win-arm64, os: windows-latest, flags: -A ARM64 } - { name: linux-x64, os: ubuntu-20.04, flags: -GNinja } - { name: osx-x64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" } # NOTE: macOS 11.0 is the first released supported by Apple Silicon. - { name: osx-arm64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" } steps: - name: Setup Linux dependencies if: runner.os == 'Linux' run: | # See https://github.com/libsdl-org/SDL/blob/main/.github/workflows/main.yml sudo apt-get update sudo apt-get install build-essential git \ pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \ libaudio-dev libjack-dev libsndio-dev libusb-1.0-0-dev libx11-dev libxext-dev \ libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \ libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \ libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev - uses: actions/checkout@v4 with: repository: 'libsdl-org/SDL' ref: 'main' - uses: actions/checkout@v4 with: path: 'SDL3-CS' - name: Configure CMake run: ${{ matrix.platform.cmake_configure_env }} cmake -B build ${{ matrix.platform.flags }} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON - name: Build run: cmake --build build/ --config Release - name: Install (Windows) run: cmake --install build/ --prefix install_output --config Release if: runner.os == 'Windows' - name: Install run: sudo cmake --install build/ --prefix install_output --config Release if: runner.os != 'Windows' - name: Prepare release directory (Windows) run: mkdir -Force SDL3-CS/native/${{ matrix.platform.name }} if: runner.os == 'Windows' - name: Prepare release directory run: mkdir -p SDL3-CS/native/${{ matrix.platform.name }} if: runner.os != 'Windows' - name: Prepare release (Windows) run: cp install_output/bin/SDL3.dll SDL3-CS/native/${{ matrix.platform.name }}/SDL3.dll if: runner.os == 'Windows' - name: Prepare release (Linux) run: cp install_output/lib/libSDL3.so SDL3-CS/native/${{ matrix.platform.name }}/libSDL3.so if: runner.os == 'Linux' - name: Prepare release (macOS) run: cp install_output/lib/libSDL3.dylib SDL3-CS/native/${{ matrix.platform.name }}/libSDL3.dylib if: runner.os == 'macOS' - name: Create pull request uses: peter-evans/create-pull-request@v6 with: commit-message: Update ${{ matrix.platform.name }} SDL binaries title: Update ${{ matrix.platform.name }} SDL binaries body: This PR has been auto-generated to update the ${{ matrix.platform.name }} SDL binaries. branch: update-${{ matrix.platform.name }}-binaries path: 'SDL3-CS' env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' build-ios: name: ios runs-on: macos-latest steps: - uses: actions/checkout@v4 with: repository: 'libsdl-org/SDL' ref: 'main' - uses: actions/checkout@v4 with: path: 'SDL3-CS' - name: Build (iOS) run: xcodebuild -project Xcode/SDL/SDL.xcodeproj -target SDL3.xcframework -configuration Release - name: Prepare release directory (iOS) run: mkdir -p SDL3-CS/native/ios - name: Prepare release (iOS) run: | mkdir -p SDL3-CS/native/ios/SDL3.xcframework/ios-arm64/SDL3.framework; mkdir -p SDL3-CS/native/ios/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework; cp Xcode/SDL/build/SDL3.xcframework/Info.plist SDL3-CS/native/ios/SDL3.xcframework/Info.plist; cp Xcode/SDL/build/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3 SDL3-CS/native/ios/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3; cp Xcode/SDL/build/SDL3.xcframework/ios-arm64/SDL3.framework/Info.plist SDL3-CS/native/ios/SDL3.xcframework/ios-arm64/SDL3.framework/Info.plist; cp Xcode/SDL/build/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/SDL3 SDL3-CS/native/ios/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/SDL3; cp Xcode/SDL/build/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist SDL3-CS/native/ios/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist; - name: Create pull request uses: peter-evans/create-pull-request@v6 with: commit-message: Update iOS SDL binaries title: Update iOS SDL binaries body: This PR has been auto-generated to update the iOS SDL binaries branch: update-ios-binaries path: 'SDL3-CS' env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'