From 4a26873503c74f6d3b4da503b3e54eed2e2cb693 Mon Sep 17 00:00:00 2001 From: FrostyApeOne <78855469+FrostyApeOne@users.noreply.github.com> Date: Wed, 14 Aug 2024 12:03:22 +0100 Subject: [PATCH] Added a new step to the build workfow to build and publish a nuget package (#563) Co-authored-by: Farshad DASHTI --- .../workflows/continuous-integration-dotnet.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/continuous-integration-dotnet.yml b/.github/workflows/continuous-integration-dotnet.yml index fe5af2b1b..4f8ac8a7f 100644 --- a/.github/workflows/continuous-integration-dotnet.yml +++ b/.github/workflows/continuous-integration-dotnet.yml @@ -97,6 +97,21 @@ jobs: reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:./CoverageReport -reporttypes:SonarQube dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + - uses: dorny/paths-filter@v3 + id: person-api-changes + with: + filters: | + client: + - 'Dfe.PersonsApi.Client/**' + + - name: Build, pack and publish + working-directory: Dfe.PersonsApi.Client + run: | + dotnet build -c Release + dotnet pack -c Release --no-build --output . + dotnet nuget push "*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/DFE-Digital/index.json + if: steps.person-api-changes.client.src == 'true' + - name: Stop containers if: always() run: docker compose -f "docker-compose.yml" down