File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,8 +208,10 @@ jobs:
208208 needs : [build_windows]
209209 environment :
210210 name : nuget
211+ permissions :
212+ id-token : write # enable GitHub OIDC token issuance for this job
211213
212- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
214+ if : github.event_name == 'release'
213215 steps :
214216 - uses : actions/checkout@v6
215217 - uses : actions/setup-dotnet@v5
@@ -219,7 +221,12 @@ jobs:
219221 with :
220222 name : nuget
221223
224+ # Get a short-lived NuGet API key
225+ - name : NuGet login (OIDC → temp API key)
226+ uses : NuGet/login@v1
227+ id : login
228+ with :
229+ user : ${{ secrets.NUGET_USER }}
230+
222231 - name : Dotnet push
223- run : dotnet nuget push "*.nupkg" --api-key ${{secrets.nuget_api_key}} --source https://api.nuget.org/v3/index.json
224- # env:
225- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
232+ run : dotnet nuget push "*.nupkg" --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
You can’t perform that action at this time.
0 commit comments