Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,9 @@ jobs:
needs: [pack-and-validate, verify-docs-build]
if: needs.pack-and-validate.outputs.has-packages == 'true'
runs-on: windows-latest
permissions:
id-token: write # required for OIDC token issuance to nuget.org
contents: read
steps:
- name: Setup .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6
Expand All @@ -691,22 +694,19 @@ jobs:
name: nuget-packages
path: ./packages

- name: Validate NuGet API key
shell: pwsh
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
if ([string]::IsNullOrEmpty($env:NUGET_API_KEY)) {
Write-Error "❌ NUGET_API_KEY secret not configured!"
Write-Host "Please add it in: Repository Settings → Secrets and variables → Actions → New repository secret"
exit 1
}
Write-Host "✅ NUGET_API_KEY is configured" -ForegroundColor Green
- name: NuGet login (OIDC → temporary API key)
# Trusted Publishing: exchange the workflow's GitHub OIDC token for an
# ephemeral (~1h) push key. No long-lived NUGET_API_KEY secret is used.
# Requires a Trusted Publishing policy for each package on nuget.org.
uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1
id: nuget-login
with:
user: Chris-Wolfgang

- name: Publish to NuGet
shell: pwsh
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
NUGET_API_KEY: ${{ steps.nuget-login.outputs.NUGET_API_KEY }}
run: |
$packages = Get-ChildItem -Path './packages' -Filter '*.nupkg' -ErrorAction SilentlyContinue

Expand Down
Loading