I'm using GitLab and I need to create a .gitlab-ci.yml
script to run the Continuous Integration pipeline for a project that generates a nuGet package.
I am having serious issues finding reliable documentation to answer this:
Should I use dotnet pack
or nuget pack
?
nuget.exe is not available as a command unless my CI script downloads it (I am using GitLab so I would have to add something on .gitlab-ci.yml
to do so) . My understanding was that dotnet
implicitly uses nuget so no need to use directly nuget.
The problem with dotnet pack command is that I cannot reference the nuspec file, it is simply ignored.
I've tried with
dotnet pack 'MyProject.Nuget/MyProject.Nuget.csproj' /p:NuspecFile='MyProject.Nuget/MyProject.NuGet.nuspec' /p:PackageVersion=$VERSION --output nupkgs
Any reliable documentation on what's the right approach for the latest version (dotnet --version
is 2.1.401) would be much appreciated as I am unable to create valid nuGet packages that contains multiple dll.
UPDATE: The alternative is:
nuget pack ./*NuGet/*.nuspec -Version $VERSION -OutputDirectory pepe -Prop Configuration=Release -NoDefaultExcludes -Verbosity detailed