# This workflow will build a .NET project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net name: .NET on: push: branches: ["main"] pull_request: branches: ["*"] paths-ignore: - "README.md" - ".github/ISSUE_TEMPLATE/**" workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - name: Set up .NET uses: actions/setup-dotnet@v5 with: dotnet-version: | 8.0.x 9.0.x 10.0.x - name: Prepare local NuGet source run: mkdir -p nuget - name: Create NuGet Package run: dotnet pack Raylib-cs -c Release --output nuget - name: Restore + Install Built Package run: | dotnet restore - name: Run Tests run: | dotnet test --verbosity normal - name: Upload NuGet Package As Artifact uses: actions/upload-artifact@v7 with: path: nuget/* - name: Upload NuGet Package As Release uses: softprops/action-gh-release@v3 if: startsWith(github.ref, 'refs/tags/') with: files: nuget/* - name: Publish to NuGet if: startsWith(github.ref, 'refs/tags/') run: | dotnet nuget push \ nuget/* \ --api-key ${{secrets.NUGET_API_KEY}}