From 160927c2063b7ebf53b77473523cf50f5270ca13 Mon Sep 17 00:00:00 2001 From: Mary Date: Fri, 18 Nov 2022 17:56:02 +0100 Subject: [PATCH] Introduce needed changes for Ryujinx's fork --- .github/workflows/build.yml | 25 +++++++++++++++++++------ .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ SDL2-CS.csproj | 9 +++++---- 3 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7354aad..f878381 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,11 @@ name: build-native on: workflow_dispatch: - inputs: {} + inputs: + rev: + description: 'Ryujinx/SDL commit to build' + required: false + default: 'master' # schedule: # - cron: '0 0 * * *' env: @@ -18,10 +22,9 @@ jobs: - { 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, target_apt_arch: ":amd64" } + - { name: linux-x64, os: ubuntu-20.04, flags: -GNinja, target_apt_arch: ":amd64" } - { name: linux-x86, os: ubuntu-20.04, flags: -GNinja, cmake_configure_env: CFLAGS=-m32 CXXFLAGS=-m32, target_apt_arch: ":i386" } - - { 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-x64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" } - { name: osx-arm64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" } steps: - name: Setup Linux dependencies @@ -71,10 +74,14 @@ jobs: libxxf86vm-dev${{ matrix.platform.target_apt_arch }} \ libdrm-dev${{ matrix.platform.target_apt_arch }} \ libgbm-dev${{ matrix.platform.target_apt_arch }} \ - libpulse-dev${{ matrix.platform.target_apt_arch }} + libpulse-dev${{ matrix.platform.target_apt_arch }} \ + libhidapi-dev${{ matrix.platform.target_apt_arch }} \ + libwayland-client++0$ \ + libwayland-cursor++0$ \ - uses: actions/checkout@v2 with: - repository: libsdl-org/SDL + repository: Ryujinx/SDL + ref: ${{ github.event.inputs.rev }} - uses: actions/checkout@v2 with: path: 'SDL2-CS' @@ -103,6 +110,12 @@ jobs: - name: Prepare release (OSX) run: cp install_output/lib/libSDL2-2.0.dylib SDL2-CS/native/${{ matrix.platform.name }}/libSDL2.dylib if: runner.os == 'macOS' + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.platform.name }}-binaries + path: install_output + if: github.event_name == 'pull_request' - name: Create pull request uses: peter-evans/create-pull-request@v4 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8ab607f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: Build + +on: + workflow_dispatch: + inputs: {} + #push: + # branches: [ master ] + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 7.0.x + - uses: nuget/setup-nuget@v1 + with: + nuget-api-key: ${{ secrets.NUGET_API_KEY }} + nuget-version: '6.x' + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal + - name: Pack & Publish + run: | + dotnet pack --version-suffix "build${{ github.run_number }}" -c Release .\SDL2-CS.csproj -o . + $file_to_publish = Get-ChildItem -Path $dir -Filter *.nupkg | Select -First 1 + echo $file_to_publish + nuget push $file_to_publish -Source https://api.nuget.org/v3/index.json diff --git a/SDL2-CS.csproj b/SDL2-CS.csproj index 94169f5..f723b46 100644 --- a/SDL2-CS.csproj +++ b/SDL2-CS.csproj @@ -8,13 +8,14 @@ libSDL2 bindings for C# SDL2 false + 2.24.2 - ppy Pty Ltd & flibitijibibo + marysaka & ppy Pty Ltd & flibitijibibo SDL2# - ppy.SDL2-CS - https://github.com/ppy/SDL2-CS - https://github.com/ppy/SDL2-CS + Ryujinx.SDL2-CS + https://github.com/Ryujinx/SDL2-CS + https://github.com/Ryujinx/SDL2-CS