Skip to content

Commit abf4195

Browse files
authored
Merge pull request #331 from FriendsOfCADability/claude/github-actions-nuget-publish-qwvi8q
Use official NuGet/login@v1 action for Trusted Publishing
2 parents d6c3502 + 0651281 commit abf4195

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/nuget.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ 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: Login to NuGet
25+
uses: NuGet/login@v1
26+
id: nuget-login
27+
with:
28+
user: FriendsOfCADability
2429
- name: Push NuGet package
2530
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"
3031
$pkg = Get-ChildItem -Path ./nupkgs -Filter "*.nupkg" | Select-Object -First 1
31-
dotnet nuget push "$($pkg.FullName)" --api-key $oidcToken --source https://api.nuget.org/v3/index.json --skip-duplicate
32+
dotnet nuget push "$($pkg.FullName)" --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)