Skip to content

Commit 4ac3198

Browse files
authored
Merge pull request #355 from devstress/copilot/fix-nuget-api-key-issue
Fix NuGet Trusted Publishing OIDC authentication in release workflows
2 parents 1314faa + eb6cc6f commit 4ac3198

13 files changed

+48
-28435
lines changed

.github/workflows/release-major.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,17 @@ jobs:
494494
name: nuget-packages
495495
path: ./packages
496496

497+
- name: NuGet login (OIDC → temp API key)
498+
uses: NuGet/login@v1
499+
id: nuget-login
500+
with:
501+
user: DarrenDatBui
502+
497503
- name: Publish to NuGet.org
498504
run: |
499505
echo "📦 Publishing packages to NuGet.org using Trusted Publishing..."
500506
dotnet nuget push "./packages/*.nupkg" \
507+
--api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} \
501508
--source https://api.nuget.org/v3/index.json \
502509
--skip-duplicate
503510
echo "✅ NuGet packages published successfully!"

.github/workflows/release-minor.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,17 @@ jobs:
494494
name: nuget-packages
495495
path: ./packages
496496

497+
- name: NuGet login (OIDC → temp API key)
498+
uses: NuGet/login@v1
499+
id: nuget-login
500+
with:
501+
user: DarrenDatBui
502+
497503
- name: Publish to NuGet.org
498504
run: |
499505
echo "📦 Publishing packages to NuGet.org using Trusted Publishing..."
500506
dotnet nuget push "./packages/*.nupkg" \
507+
--api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} \
501508
--source https://api.nuget.org/v3/index.json \
502509
--skip-duplicate
503510
echo "✅ NuGet packages published successfully!"

.github/workflows/release-patch.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,17 @@ jobs:
494494
name: nuget-packages
495495
path: ./packages
496496

497+
- name: NuGet login (OIDC → temp API key)
498+
uses: NuGet/login@v1
499+
id: nuget-login
500+
with:
501+
user: DarrenDatBui
502+
497503
- name: Publish to NuGet.org
498504
run: |
499505
echo "📦 Publishing packages to NuGet.org using Trusted Publishing..."
500506
dotnet nuget push "./packages/*.nupkg" \
507+
--api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} \
501508
--source https://api.nuget.org/v3/index.json \
502509
--skip-duplicate
503510
echo "✅ NuGet packages published successfully!"

.github/workflows/retry-publish.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,17 @@ jobs:
5555
ls -la ./packages/
5656
ls -la ./docker/
5757
58+
- name: NuGet login (OIDC → temp API key)
59+
uses: NuGet/login@v1
60+
id: nuget-login
61+
with:
62+
user: DarrenDatBui
63+
5864
- name: Publish to NuGet.org
5965
run: |
6066
echo "📦 Publishing packages to NuGet.org using Trusted Publishing..."
6167
dotnet nuget push "./packages/*.nupkg" \
68+
--api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} \
6269
--source https://api.nuget.org/v3/index.json \
6370
--skip-duplicate
6471
echo "✅ NuGet packages published successfully!"

0 commit comments

Comments
 (0)