Watch
2
0
Fork
You've already forked raylib-cs
0
raylib-cs/.github/workflows/build.yml

60 lines
1.3 KiB
YAML

# 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: ["master"]
pull_request:
branches: ["*"]
paths-ignore:
- "README.md"
- ".github/ISSUE_TEMPLATE/**"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- 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@v4
with:
path: nuget/*
- name: upload NuGet Package As Release
uses: softprops/action-gh-release@v1
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}}