From b6e8330d71164d4d3bdab15bc12b2c0ebdcafc34 Mon Sep 17 00:00:00 2001 From: Mary Date: Fri, 18 Nov 2022 18:04:32 +0100 Subject: [PATCH] Introduce needed changes for Ryujinx's fork --- .github/workflows/build.yml | 29 ++++++++++++++++++++--------- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ SDL2-CS.csproj | 19 +++++-------------- 3 files changed, 59 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff1fa01..bc30c76 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: @@ -16,12 +20,11 @@ jobs: matrix: platform: - { name: win-x64, os: windows-latest, flags: -A x64 } - - { name: win-x86, os: windows-latest, flags: -A Win32 } + #- { 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-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: 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="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,11 +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@v3 with: - repository: 'libsdl-org/SDL' - ref: 'SDL2' + repository: Ryujinx/SDL + ref: ${{ github.event.inputs.rev }} - uses: actions/checkout@v3 with: path: 'SDL2-CS' @@ -104,6 +110,11 @@ jobs: - name: Prepare release (macOS) 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 - 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 2577901..1042b40 100644 --- a/SDL2-CS.csproj +++ b/SDL2-CS.csproj @@ -8,13 +8,14 @@ libSDL2 bindings for C# SDL2 false + 2.27.0 - 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 @@ -27,11 +28,6 @@ runtimes/win-arm64/native true - - PreserveNewest - runtimes/win-x86/native - true - PreserveNewest runtimes/osx-x64/native @@ -47,11 +43,6 @@ runtimes/linux-x64/native true - - PreserveNewest - runtimes/linux-x86/native - true - PreserveNewest runtimes/ios/native