From 5f1ec37fe29a79b5c8205f2aa301844f658ed738 Mon Sep 17 00:00:00 2001 From: ognjenkatic Date: Tue, 10 Nov 2026 10:17:04 +0100 Subject: [PATCH 1/2] ci: publish to nuget.org with trusted publishing Replace the long-lived NUGET_API_KEY secret with NuGet/login, which exchanges the workflow OIDC token for a short-lived API key right before the pushes. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1634b198..b651749a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,10 @@ jobs: runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: - name: Checkout repository uses: actions/checkout@v3 @@ -33,13 +37,19 @@ jobs: - name: Create ConductorSharp.KafkaCancellationNotifier package run: dotnet pack --no-restore ./src/ConductorSharp.KafkaCancellationNotifier -c Release + - name: NuGet login + uses: NuGet/login@v1 + id: login + with: + user: ${{ secrets.NUGET_USER }} + - name: Publish ConductorSharp.Client package - run: dotnet nuget push ./src/ConductorSharp.Client/bin/Release/ConductorSharp.Client*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json + run: dotnet nuget push ./src/ConductorSharp.Client/bin/Release/ConductorSharp.Client*.nupkg --skip-duplicate --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - name: Publish ConductorSharp.Engine package - run: dotnet nuget push ./src/ConductorSharp.Engine/bin/Release/ConductorSharp.Engine*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json + run: dotnet nuget push ./src/ConductorSharp.Engine/bin/Release/ConductorSharp.Engine*.nupkg --skip-duplicate --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - name: Publish ConductorSharp.Patterns package - run: dotnet nuget push ./src/ConductorSharp.Patterns/bin/Release/ConductorSharp.Patterns*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json + run: dotnet nuget push ./src/ConductorSharp.Patterns/bin/Release/ConductorSharp.Patterns*.nupkg --skip-duplicate --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - name: Publish ConductorSharp.Toolkit package - run: dotnet nuget push ./src/ConductorSharp.Toolkit/bin/Release/ConductorSharp.Toolkit*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json + run: dotnet nuget push ./src/ConductorSharp.Toolkit/bin/Release/ConductorSharp.Toolkit*.nupkg --skip-duplicate --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - name: Publish ConductorSharp.KafkaCancellationNotifier package - run: dotnet nuget push ./src/ConductorSharp.KafkaCancellationNotifier/bin/Release/ConductorSharp.KafkaCancellationNotifier*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json + run: dotnet nuget push ./src/ConductorSharp.KafkaCancellationNotifier/bin/Release/ConductorSharp.KafkaCancellationNotifier*.nupkg --skip-duplicate --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json From 4f94258ff28c0603442e5992d500044049b926b1 Mon Sep 17 00:00:00 2001 From: ognjenkatic Date: Tue, 10 Nov 2026 10:22:58 +0100 Subject: [PATCH 2/2] ci: read NUGET_USER from a repository variable Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b651749a..78b6dc98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: uses: NuGet/login@v1 id: login with: - user: ${{ secrets.NUGET_USER }} + user: ${{ vars.NUGET_USER }} - name: Publish ConductorSharp.Client package run: dotnet nuget push ./src/ConductorSharp.Client/bin/Release/ConductorSharp.Client*.nupkg --skip-duplicate --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json