Deploy to NuGet #16
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: Deploy to NuGet | |
on: workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "6.0.x" | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Test | |
run: dotnet test -p:CollectCoverage=true -p:CoverletOutput=TestResults/ -p:CoverletOutputFormat=opencover --configuration Release --no-build --verbosity normal CatConsult.PaginationHelper.Tests/ | |
- name: Create Test Coverage Badge | |
uses: simon-k/[email protected] | |
id: create_coverage_badge | |
with: | |
label: Unit Test Coverage | |
color: brightgreen | |
path: CatConsult.PaginationHelper.Tests/TestResults/coverage.opencover.xml | |
gist-filename: code-coverage.json | |
gist-id: 33a4dd1f54e8b9cf42cb49328e0c282a | |
gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }} | |
- name: Deploy | |
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_DEPLOY_KEY}} |