From 4311bcac973bab7195b0425c7d9350053f6ae41c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 20 Sep 2026 14:42:28 +0000 Subject: [PATCH] Migrate release workflow to NuGet trusted publishing (OIDC) Co-authored-by: SteveWinward <2002602+SteveWinward@users.noreply.github.com> --- .github/workflows/release_build.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 8173035..924b085 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -11,6 +11,10 @@ env: # setting the dotnet version DOTNET_VERSION: '8.0.x' +permissions: + id-token: write # Required for NuGet trusted publishing (OIDC) + contents: read + jobs: build: @@ -38,6 +42,13 @@ jobs: - name: Unit Tests run: dotnet test --no-build --verbosity normal --configuration Release + # Obtain a short-lived NuGet API key via OIDC trusted publishing + - name: NuGet login + uses: NuGet/login@v1 + id: login + with: + user: ${{ secrets.NUGET_USER }} + # Publish the Nuget file to Nuget.org - name: PushNuget - run: dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate + run: dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --skip-duplicate