use old build again #109
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Natives | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - lib/** | |
| - src/Raylib.NET.Native/** | |
| - .github/workflows/build-natives.yml | |
| jobs: | |
| natives: | |
| strategy: | |
| matrix: | |
| runtime: | |
| - linux-x64 | |
| - linux-x86 | |
| - linux-arm64 | |
| # - browser-wasm | |
| - osx-x64 | |
| - osx-arm64 | |
| - win-x64 | |
| - win-x86 | |
| - win-arm64 | |
| config: [Debug, Release] | |
| os: [ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Setup Environment (x64) | |
| if: matrix.os == 'ubuntu-latest' && matrix.runtime == 'linux-x64' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| gcc-multilib \ | |
| libgl1-mesa-dev \ | |
| libx11-dev \ | |
| libxcursor-dev \ | |
| libxrandr-dev \ | |
| libxinerama-dev \ | |
| libxi-dev \ | |
| libxext-dev \ | |
| libxfixes-dev \ | |
| libwayland-dev \ | |
| libxkbcommon-dev | |
| - name: Setup Environment (x86) | |
| if: matrix.os == 'ubuntu-latest' && matrix.runtime == 'linux-x86' | |
| run: | | |
| sudo dpkg --add-architecture i386 | |
| sudo apt-get update | |
| # Install dependencies | |
| sudo apt-get install -y --no-install-recommends \ | |
| libgl1-mesa-dev:i386 \ | |
| libx11-dev:i386 \ | |
| libxcursor-dev:i386 \ | |
| libxrandr-dev:i386 \ | |
| libxinerama-dev:i386 \ | |
| libxi-dev:i386 \ | |
| libxext-dev:i386 \ | |
| libxfixes-dev:i386 \ | |
| libwayland-dev:i386 \ | |
| libxkbcommon-dev:i386 | |
| - name: Setup Environment (arm64) | |
| if: matrix.os == 'ubuntu-latest' && matrix.runtime == 'linux-arm64' | |
| run: | | |
| sudo dpkg --add-architecture arm64 | |
| sudo apt-get install -y lsb-release | |
| # Restrict main sources to amd64 only | |
| sudo sed -i '/^Components:/a Architectures: amd64' /etc/apt/sources.list.d/ubuntu.sources | |
| # Add ports sources for arm64 | |
| UBUNTU_CODENAME=$(lsb_release -cs) | |
| sudo tee /etc/apt/sources.list.d/ubuntu-ports.sources << EOF | |
| Types: deb | |
| URIs: http://ports.ubuntu.com/ubuntu-ports/ | |
| Suites: $UBUNTU_CODENAME $UBUNTU_CODENAME-updates $UBUNTU_CODENAME-backports | |
| Components: main universe restricted multiverse | |
| Architectures: arm64 | |
| Types: deb | |
| URIs: http://ports.ubuntu.com/ubuntu-ports/ | |
| Suites: $UBUNTU_CODENAME-security | |
| Components: main universe restricted multiverse | |
| Architectures: arm64 | |
| EOF | |
| sudo apt-get update | |
| # Install dependencies | |
| sudo apt-get install -y --no-install-recommends \ | |
| libgl1-mesa-dev:arm64 \ | |
| libx11-dev:arm64 \ | |
| libxcursor-dev:arm64 \ | |
| libxrandr-dev:arm64 \ | |
| libxinerama-dev:arm64 \ | |
| libxi-dev:arm64 \ | |
| libxext-dev:arm64 \ | |
| libxfixes-dev:arm64 \ | |
| libwayland-dev:arm64 \ | |
| libxkbcommon-dev:arm64 | |
| - name: Setup EMSDK | |
| if: matrix.runtime == 'browser-wasm' | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| actions-cache-folder: 'emsdk-cache' | |
| - name: Build Natives | |
| run: dotnet build -c ${{ matrix.config }} -r ${{ matrix.runtime }} | |
| working-directory: src/Raylib.NET.Native | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: natives-${{ matrix.config }}-${{ matrix.runtime }} | |
| path: src/Raylib.NET.Native/bin/${{ matrix.config }}/runtimes/** | |
| if-no-files-found: error | |
| upload-packages: | |
| permissions: | |
| packages: write | |
| runs-on: ubuntu-latest | |
| needs: | |
| - natives | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Download Debug Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: natives-Debug-* | |
| path: src/Raylib.NET.Native/bin/Debug/runtimes | |
| merge-multiple: true | |
| - name: Download Release Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: natives-Release-* | |
| path: src/Raylib.NET.Native/bin/Release/runtimes | |
| merge-multiple: true | |
| - name: Generate NuGet Version | |
| id: package-info | |
| run: | | |
| version="build.$(git rev-list --count HEAD)" | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| - name: Create NuGet Debug Packages | |
| run: dotnet pack src/Raylib.NET.Native -c Debug --output nuget -p:SkipNatives=true -p:SkipGen=true -p:VersionSuffix=${{ steps.package-info.outputs.version }} | |
| - name: Create NuGet Release Packages | |
| run: dotnet pack src/Raylib.NET.Native -c Release --output nuget -p:SkipNatives=true -p:SkipGen=true -p:VersionSuffix=${{ steps.package-info.outputs.version }} | |
| - name: Upload NuGet Packages As Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-packages | |
| path: nuget/* | |
| - name: Publish NuGet Packages to GitHub Packages | |
| run: dotnet nuget push nuget/*.nupkg -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate |