From 5710fd5ec11f61084d1e99d0f72ed366562824c5 Mon Sep 17 00:00:00 2001 From: Simon Jefferies <11839289+olivegamestudio@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:35:35 +0100 Subject: [PATCH] Create dotnet.yml --- .github/workflows/dotnet.yml | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..8434815 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,44 @@ +# 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", "develop" ] + pull_request: + branches: [ "main", "develop" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + filter: tree:0 + + - name: Get tags + run: git fetch --tags origin + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test --configuration Release -p:CollectCoverage=true + + - name: Publish Nuget + run: | + dotnet nuget push '**/*.nupkg' -k ${NUGET} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols + env: + NUGET: ${{ secrets.NUGET }}