Skip to content

Commit ff0a22c

Browse files
Fix nuget publish when symbols aren't required to nuget push (#69) (#70)
* add option for not publishing symbols for production release * bad folder name
1 parent d6f8418 commit ff0a22c

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

build.fsx

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,26 @@ Target "PublishNuget" (fun _ ->
170170
let apiKey = getBuildParamOrDefault "nugetkey" ""
171171
let source = getBuildParamOrDefault "nugetpublishurl" ""
172172
let symbolSource = getBuildParamOrDefault "symbolspublishurl" ""
173+
let shouldPublishSymbolsPackages = not (symbolSource = "")
173174

174-
let runSingleProject project =
175-
DotNetCli.RunCommand
176-
(fun p ->
177-
{ p with
178-
TimeOut = TimeSpan.FromMinutes 10. })
179-
(sprintf "nuget push %s --api-key %s --source %s --symbol-source %s" project apiKey source symbolSource)
175+
if (not (source = "") && not (apiKey = "") && shouldPublishSymbolsPackages) then
176+
let runSingleProject project =
177+
DotNetCli.RunCommand
178+
(fun p ->
179+
{ p with
180+
TimeOut = TimeSpan.FromMinutes 10. })
181+
(sprintf "nuget push %s --api-key %s --source %s --symbol-source %s" project apiKey source symbolSource)
182+
183+
projects |> Seq.iter (runSingleProject)
184+
else if (not (source = "") && not (apiKey = "") && not shouldPublishSymbolsPackages) then
185+
let runSingleProject project =
186+
DotNetCli.RunCommand
187+
(fun p ->
188+
{ p with
189+
TimeOut = TimeSpan.FromMinutes 10. })
190+
(sprintf "nuget push %s --api-key %s --source %s" project apiKey source)
180191

181-
projects |> Seq.iter (runSingleProject)
192+
projects |> Seq.iter (runSingleProject)
182193
)
183194

184195
//--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)