I want to publish nuget packages from FAKE. But I don't use NuGet to create those packages. I have OctoPack installed in some projects and I'm running build with /p:RunOctoPack=True. This dumps .nupkg files in bin directory. How do I then collect those packages and push them to NuGet server? I can't seem to make NuGetPublish and FileIncludes to work together.
edit: for now I've 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"
)
As Steffen mentioned, you can use NuGet Publish task, it is described in the API but there is no tutorial for this.
Your script code could 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:
My.Super.Project
)0.0.10
)The full nupkg file name that this task will be looking for is:
WorkingDir\Project.Version.nupkg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With