Skip to content

Merge pull request #66 from PensionDanmark/dependabot/nuget/src/STIL.… #42

Merge pull request #66 from PensionDanmark/dependabot/nuget/src/STIL.…

Merge pull request #66 from PensionDanmark/dependabot/nuget/src/STIL.… #42

Workflow file for this run

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