Publish external packages

I want to publish FAKE nuget packages. But I do not use NuGet to create these packages. I have OctoPack installed in some projects and I run build with / p: RunOctoPack = True. This flushes the .nupkg files in the bin directory. How do I collect these packages and forward them to the NuGet server? I cannot get NuGetPublish and FileIncludes to work together.

edit: while I worked around it using ExecProcess

Target "Publish" (fun _ -> let result = ExecProcess (fun info -> info.FileName <- "MySolution/.nuget/NuGet.exe" info.WorkingDirectory <- "MySolutionDirectory" info.Arguments <- "push \"**/bin/**/*.nupkg\" -s http://my-nuget-server") TimeSpan.MaxValue if result <> 0 then failwithf "NuGet.exe push returned with a non-zero exit code" 

)

+7
source share
2 answers

As Steffen mentioned, you can use the NuGet Publish task, it is described in the API, but there is no tutorial for this.

Your script code might look like this:

 NuGetPublish (fun nugetParams -> { nugetParams with AccessKey = "nuget_api_key" PublishUrl = "nuget_feed_url" Project = "project_name" Version = "project_version" WorkingDir = "nupkg_file_location" } ) 

Where:

  • The project is the main part of your nupkg file name (i.e. My.Super.Project )
  • Version is part of the version of your nupkg file name (i.e. 0.0.10 )
  • WorkingDir - location of your nukpg file

The full name of the nupkg file this task will look for:

WorkingDir\Project.Version.nupkg

+2
source

We have a NuGetPublish task that should do exactly what you need.

+1
source

All Articles