Description
The bug
The octopus package nuget create
command generates nupkg files without metadata required by certain NuGet external feed providers supported by Octopus Deploy (e.g. Cloudsmith) to treat them as valid. When pushing these NuGet packages to the external feed, the request is rejected.
The old dotnet.octopus.cli
tool (dotnet octo
) created valid NuGet packages that could be pushed to feeds like Cloudsmith. This tool appears to be deprecated.
There also exists a NuGet CLI tool (nuget.exe
), however this no longer works on Ubuntu 24.04 as it relies on Mono, which is no longer supported.
The newer dotnet pack
tooling does not support creating NuGet packages out of plain files as is expected by Octopus Deploy's feeds. (It relies on a .csproj project being passed in to generate a .NET library package)
Command to reproduce
mkdir -p input
touch input/test.txt
octopus package nuget create --id test --version 0.1 --author "Required to generate nuspec" --base-path input --out-folder . --verbose --no-prompt
dotnet nuget push -s "https://<Cloudsmith feed url>/v3/index.json" -k "<Cloudsmith API key>" test.0.1.nupkg
Outcome
Here's the console output that happens right now:
Pushing test.0.1.nupkg to 'https://<Cloudsmith feed url>/v2/package'...
PUT https://<Cloudsmith feed url>/v2/package/
BadRequest https://<Cloudsmith feed url>/v2/package/ 867ms
error: Response status code does not indicate success: 400 (Bad Request).
Using Fiddler, I caught the HTTP response body to be the following:
{"ok": false, "error": "Could not upload artifact: Failed to get .rels XML from NuGet package and find .nuspec XML"}
When using the older tool dotnet octo pack
instead, valid NuGet packages are created and these can be pushed to NuGet external feeds like Cloudsmith.
Versions
cli: 2.14.2
Octopus Server: N/A
Activity