Skip to content

Commit 492bbb4

Browse files
fix(ci): use NuGetAuthenticate + dotnet nuget push (#682)
NuGetCommand@2 requires Mono on Ubuntu 24.04+. DotNetCoreCLI@2 can't handle encrypted API keys. Using NuGetAuthenticate@1 to set up creds then dotnet nuget push directly works on all agents without Mono. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8ecac50 commit 492bbb4

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pipelines/esrp-publish.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,16 @@ stages:
356356
ls -la $(Pipeline.Workspace)/nuget-publish/
357357
displayName: 'List packages'
358358
359-
- task: NuGetCommand@2
360-
displayName: 'Push to NuGet.org'
359+
- task: NuGetAuthenticate@1
360+
displayName: 'Authenticate to NuGet.org'
361361
inputs:
362-
command: 'push'
363-
packagesToPush: '$(Pipeline.Workspace)/nuget-publish/**/*.nupkg;!$(Pipeline.Workspace)/nuget-publish/**/*.symbols.nupkg'
364-
nuGetFeedType: 'external'
365-
publishFeedCredentials: 'NuGet.org'
362+
nuGetServiceConnections: 'NuGet.org'
363+
364+
- script: |
365+
dotnet nuget push "$(Pipeline.Workspace)/nuget-publish/**/*.nupkg" \
366+
--source https://api.nuget.org/v3/index.json \
367+
--skip-duplicate
368+
displayName: 'Push to NuGet.org'
366369
367370
# =======================================================
368371
# RUST (crates.io) — agentmesh crate

0 commit comments

Comments
 (0)