init project #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish to nuget | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
name: build, pack & publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: Run tests | |
run: dotnet test | |
- name: Build and generate NuGet package | |
run: dotnet pack -c Release -o out | |
- name: Publish to NuGet | |
run: | | |
cd out | |
dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |