Merge pull request #71 from PensionDanmark/dependabot/nuget/src/STIL.… #43
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.org | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main # Default release branch | |
paths-ignore: | |
- '**/README.md' | |
- '**/.github/**' | |
- '**/STIl.ServiceClient.Tests/**' | |
jobs: | |
publish: | |
name: build, test, pack & publish | |
runs-on: ubuntu-latest | |
env: | |
PROJECT_PATH: ./src/STIL.ServiceClient/STIL.ServiceClient.csproj | |
TEST_PATH: ./src/STIL.ServiceClient.Tests/STIL.ServiceClient.Tests.csproj | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.0.x | |
- name: Install dependencies | |
run: dotnet restore ${{ env.PROJECT_PATH }} | |
- name: Build | |
run: dotnet build ${{ env.PROJECT_PATH }} -c Release --no-restore | |
- name: Test | |
run: dotnet test ${{ env.TEST_PATH }} -c Release | |
- name: Package | |
if: github.ref == 'refs/heads/main' | |
run: dotnet pack -c Release -o . ${{ env.PROJECT_PATH }} | |
- name: Publish | |
if: github.ref == 'refs/heads/main' | |
run: dotnet nuget push **.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json |