Related Issue: https://github.com/NuGet/Home/issues/1630
In the related issue, NuGet.exe push was given a new option, -SkipDuplicate. This option needs to be made available in DotNet.exe nuget push as --skip-duplicate.
NuGet product used: dotnet.exe
Really? We've waited so long (3.5 years) for https://github.com/NuGet/Home/issues/1630 to be released, now we have to wait again for dotnet
to support it?
To clarify my expectation: https://github.com/NuGet/Home/issues/1630 should have included the required changes to dotnet
. Without that, the feature is of little use. No one really wants to go back to bootstrapping nuget.exe in build scripts. The expectation is to use always use dotnet
.
In which version of the .NET SDK can we expect this change?
It has missed NuGet 5.3 release. We hope to get it in 5.4, but it is currently behind some other priorities. 5.4 would likely mean 3.0.200 would have it. (to clarify...some test infrastructure investigation and test work is what still remains for the dotnet.exe side of this work -- coding is the easy part - making sure it is well tested is more challenging)
In which version of the .NET SDK can we expect this change?
@adamralph - should be in NET Core 3.1 SDK
I've just tried the --skip-duplicate successfully with azure pipelines and dotnet core 3.1 preview
- task: NuGetAuthenticate@0
displayName: 'Authenticate in NuGet feed'
- task: UseDotNet@2
displayName: 'Use latest .NET Core sdk 3.x'
inputs:
packageType: sdk
version: 3.x
includePreviewVersions: true
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet nuget push $(PATH_PIPELINE_ARTIFACT_NAME)/**/*.nupkg --source $(NUGET_FEED) --api-key $(NUGET_API_KEY) --skip-duplicate
displayName: 'Uploads nuGet packages'
Not sure if this is related, but I had:
dotnet nuget push ./output/*.nupkg --skip-duplicate --api-key ${NUGET_API_KEY} --source ${NUGET_FEED}
And it would only find the first file, changing it to
dotnet nuget push ./output/**/*.nupkg --skip-duplicate --api-key ${NUGET_API_KEY} --source ${NUGET_FEED}
Solved my problem, despite the ./output
folder looking like:
./output/AssemblyFoo.1.0.1.nupkg
./output/AssemblyFoo.1.0.1.symbols.nupkg
./output/AssemblyBar.6.5.4.nupkg
./output/AssemblyBar.6.5.4.symbols.nupkg
I guess the globing algorithm for dotnet nuget push
is just non-obvious.
I also met both *.nupkg
and **/*.nupkg
just push only first package despite setting --skip-duplicate
or not.
Are you on linux?
I have to use quotes on linux, otherwise --skip-duplicate has no effect.
dotnet nuget push "src/**/src/bin/Release/*.nupkg"
However, on windows, it seems to work without quotes:
dotnet nuget push src/**/src/bin/Release/*.nupkg
I wasn't knew that, let me try.
I've confirm dotnet nuget push "./src/**/*.nupkg"
works on linux. Thanks!! @davidroth
Most helpful comment
To clarify my expectation: https://github.com/NuGet/Home/issues/1630 should have included the required changes to
dotnet
. Without that, the feature is of little use. No one really wants to go back to bootstrapping nuget.exe in build scripts. The expectation is to use always usedotnet
.