Skip to content

v1.0.0

v1.0.0 #5

Workflow file for this run

name: .NET
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_VERSION: 8.0.x
PackageDir: ${{ github.workspace }}/nuget
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
pack:
runs-on: ubuntu-latest
needs: [ build ]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Pack
run: dotnet pack --configuration Release --output ${{ env.PackageDir }}
- uses: actions/upload-artifact@v3
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: ${{ env.PackageDir }}/*.nupkg
publish:
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: [ build, pack ]
steps:
- uses: actions/download-artifact@v3
with:
name: nuget
path: ${{ env.PackageDir }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Publish Nuget package
run: dotnet nuget push ${{ env.PackageDir }}/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_APIKEY }} --skip-duplicate