Skip to content

.NET

.NET #30

name: .NET
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
publish:
description: 'Publish nuget package'
required: false
default: ''
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore --output .\Release
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Publish NuGet
if: ${{ github.event.inputs.publish != '' }}
run: dotnet nuget push ".\Release\*.nupkg" --api-key ${{secrets.nuget_api_key}} --source https://api.nuget.org/v3/index.json