@@ -13,7 +13,7 @@ open Fake.DocFxHelper
1313let configuration = " Release"
1414
1515// Directories
16- let output = __ SOURCE_ DIRECTORY__ @@ " build "
16+ let output = __ SOURCE_ DIRECTORY__ @@ " bin "
1717let outputTests = output @@ " tests"
1818let outputBinaries = output @@ " binaries"
1919let outputNuGet = output @@ " nuget"
@@ -60,13 +60,41 @@ Target "CreateNuget" (fun _ ->
6060 DotNetCli.Pack
6161 ( fun p ->
6262 { p with
63- Project = " ./** /Akka.Logger.Serilog.csproj"
63+ Project = " ./src/Akka.Logger.Serilog /Akka.Logger.Serilog.csproj"
6464 Configuration = configuration
6565 AdditionalArgs = [ " --include-symbols" ]
6666 VersionSuffix = versionSuffix
6767 OutputPath = outputNuGet })
6868)
6969
70+ Target " PublishNuget" ( fun _ ->
71+ let projects = !! " ./bin/nuget/*.nupkg" -- " ./bin/nuget/*.symbols.nupkg"
72+ let apiKey = getBuildParamOrDefault " nugetkey" " "
73+ let source = getBuildParamOrDefault " nugetpublishurl" " "
74+ let symbolSource = getBuildParamOrDefault " symbolspublishurl" " "
75+ let shouldPublishSymbolsPackages = not ( symbolSource = " " )
76+
77+ if ( not ( source = " " ) && not ( apiKey = " " ) && shouldPublishSymbolsPackages) then
78+ let runSingleProject project =
79+ DotNetCli.RunCommand
80+ ( fun p ->
81+ { p with
82+ TimeOut = TimeSpan.FromMinutes 10. })
83+ ( sprintf " nuget push %s --api-key %s --source %s --symbol-source %s " project apiKey source symbolSource)
84+
85+ projects |> Seq.iter ( runSingleProject)
86+ else if ( not ( source = " " ) && not ( apiKey = " " ) && not shouldPublishSymbolsPackages) then
87+ let runSingleProject project =
88+ DotNetCli.RunCommand
89+ ( fun p ->
90+ { p with
91+ TimeOut = TimeSpan.FromMinutes 10. })
92+ ( sprintf " nuget push %s --api-key %s --source %s " project apiKey source)
93+
94+ projects |> Seq.iter ( runSingleProject)
95+ )
96+
97+
7098//--------------------------------------------------------------------------------
7199// Target dependencies
72100//--------------------------------------------------------------------------------
@@ -80,6 +108,7 @@ Target "Nuget" DoNothing
80108
81109// nuget dependencies
82110" Clean" ==> " RestorePackages" ==> " Build" ==> " CreateNuget"
111+ " CreateNuget" ==> " PublishNuget" ==> " Nuget"
83112
84113// all
85114" BuildRelease" ==> " All"
0 commit comments