From e80647d4fe84285af7dc1a2e27861e2045115261 Mon Sep 17 00:00:00 2001 From: Stephen Walsh <868017+stphnwlsh@users.noreply.github.com> Date: Tue, 27 Oct 2026 00:33:10 +0000 Subject: [PATCH] Publish to NuGet with trusted publishing --- .github/workflows/build-pipeline.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-pipeline.yml b/.github/workflows/build-pipeline.yml index 08d8146..250b4a8 100644 --- a/.github/workflows/build-pipeline.yml +++ b/.github/workflows/build-pipeline.yml @@ -132,6 +132,7 @@ jobs: needs: pipeline permissions: contents: read + id-token: write strategy: fail-fast: true @@ -193,7 +194,14 @@ jobs: SUFFIX: ${{ steps.initialize.outputs.version_suffix }} shell: bash + - name: Login to NuGet + id: nuget-login + if: ${{ github.ref == 'refs/heads/main' }} + uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0 + with: + user: ${{ secrets.NUGET_USER }} + - name: Publish id: publish if: ${{ github.ref == 'refs/heads/main' }} - run: dotnet nuget push template/**/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} + run: dotnet nuget push template/**/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }}