Skip to content

Update dotnet.yml

Update dotnet.yml #172

Workflow file for this run

# 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: [ "main" ]
jobs:
test:
runs-on: windows-latest
steps:
- uses: actions/[email protected]
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.x
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
deploy:
runs-on: windows-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/[email protected]
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.x
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: PublishNuget
run: dotnet nuget push "**/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.PUBLISH_TO_NUGET }} --skip-duplicate