File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,11 +6,16 @@ defaults:
66 run :
77 working-directory : Src
88
9+ permissions :
10+ id-token : write # required for Nuget Trusted Publishing
11+
912jobs :
1013 publish :
11-
1214 runs-on : ubuntu-latest
13-
15+
16+ permissions :
17+ id-token : write # enable GitHub OIDC (OpenID Connect standard) token issuance for this job
18+
1419 steps :
1520 - uses : actions/checkout@v4
1621 - name : Setup .NET
2530 run : dotnet test -c Release --no-build --framework net8.0
2631 - name : Pack nugets
2732 run : dotnet pack "./UUIDNext/UUIDNext.csproj" -c Release --no-build --output .
33+
34+ # Get a short-lived NuGet API key
35+ - name : NuGet login (OIDC → temp API key)
36+ uses : NuGet/login@v1
37+ id : login
38+ with :
39+ user : ${{ secrets.NUGET_USER }}
40+
2841 - name : Push to NuGet
29- run : dotnet nuget push "UUIDNext.*.nupkg" --api-key ${{secrets .NUGET_API_KEY}} --skip-duplicate --source https://api.nuget.org/v3/index.json
42+ run : dotnet nuget push "UUIDNext.*.nupkg" --api-key ${{steps.login.outputs .NUGET_API_KEY}} --skip-duplicate --source https://api.nuget.org/v3/index.json
You can’t perform that action at this time.
0 commit comments