File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,20 +21,11 @@ jobs:
2121 run : dotnet build CADability/CADability.csproj -c Release --no-restore
2222 - name : Pack
2323 run : dotnet pack CADability/CADability.csproj -c Release --no-build -o ./nupkgs
24- - name : Get NuGet publish token
25- run : |
26- $tokenRequest = Invoke-RestMethod `
27- -Uri "$env:ACTIONS_ID_TOKEN_REQUEST_URL&audience=nuget.org" `
28- -Headers @{Authorization = "Bearer $env:ACTIONS_ID_TOKEN_REQUEST_TOKEN"}
29- $body = ConvertTo-Json @{oidcToken = $tokenRequest.value}
30- $nugetToken = (Invoke-RestMethod `
31- -Method Post `
32- -Uri "https://www.nuget.org/packages/publish/oidc" `
33- -Body $body `
34- -ContentType "application/json").token
35- Write-Output "::add-mask::$nugetToken"
36- echo "NUGET_TOKEN=$nugetToken" >> $env:GITHUB_ENV
3724 - name : Push NuGet package
3825 run : |
26+ $oidcToken = (Invoke-RestMethod `
27+ -Uri "$env:ACTIONS_ID_TOKEN_REQUEST_URL&audience=nuget.org" `
28+ -Headers @{Authorization = "Bearer $env:ACTIONS_ID_TOKEN_REQUEST_TOKEN"}).value
29+ Write-Output "::add-mask::$oidcToken"
3930 $pkg = Get-ChildItem -Path ./nupkgs -Filter "*.nupkg" | Select-Object -First 1
40- dotnet nuget push "$($pkg.FullName)" --api-key "$env:NUGET_TOKEN" --source https://api.nuget.org/v3/index.json --skip-duplicate
31+ dotnet nuget push "$($pkg.FullName)" --api-key $oidcToken --source https://api.nuget.org/v3/index.json --skip-duplicate
You can’t perform that action at this time.
0 commit comments