File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1414jobs :
1515 build :
1616 runs-on : windows-latest
17+ permissions :
18+ contents : write # For release asset upload
19+ id-token : write # Required for OIDC token (NuGet Trusted Publishing)
1720 steps :
1821 - name : 🚚 Checkout code
1922 uses : actions/checkout@v4
6164 ./nupkg/*.nupkg
6265 ./nupkg/*.snupkg
6366
67+ - name : 🔑 Login to NuGet (OIDC)
68+ id : nuget-login
69+ uses : nuget/login@v1
70+ if : github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run != 'true')
71+ with :
72+ nuget-api-url : https://api.nuget.org/v3/index.json
73+
6474 - name : 🚀 Publish to NuGet
6575 shell : pwsh
6676 run : |
8898 Write-Host "Publishing to NuGet..."
8999 foreach ($file in $nupkgFiles) {
90100 Write-Host "Publishing: $($file.FullName)"
91- dotnet nuget push "$($file.FullName)" --api-key ${{ secrets .NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json" --skip-duplicate
101+ dotnet nuget push "$($file.FullName)" --api-key ${{ steps.nuget-login.outputs .NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json" --skip-duplicate
92102 }
93103 }
You can’t perform that action at this time.
0 commit comments