diff --git a/build.fsx b/build.fsx index 9ccc4f5ed88..07a119e0011 100644 --- a/build.fsx +++ b/build.fsx @@ -471,7 +471,7 @@ Target "CreateMntrNuget" (fun _ -> Target "PublishNuget" (fun _ -> let nugetExe = FullName @"./tools/nuget.exe" - let rec publishPackage url accessKey trialsLeft packageFile = + let rec publishPackage url apiKey trialsLeft packageFile = let tracing = enableProcessTracing enableProcessTracing <- false let args p = @@ -481,19 +481,17 @@ Target "PublishNuget" (fun _ -> tracefn "Pushing %s Attempts left: %d" (FullName packageFile) trialsLeft try - let result = ExecProcess (fun info -> - info.FileName <- nugetExe - info.WorkingDirectory <- (Path.GetDirectoryName (FullName packageFile)) - info.Arguments <- args (packageFile, accessKey,url)) (System.TimeSpan.FromMinutes 1.0) - enableProcessTracing <- tracing - if result <> 0 then failwithf "Error during NuGet symbol push. %s %s" nugetExe (args (packageFile, "key omitted",url)) + DotNetCli.RunCommand + (fun p -> + { p with + TimeOut = TimeSpan.FromMinutes 10. }) + (sprintf "nuget push %s --api-key %s --source %s" packageFile apiKey url) with exn -> - if (trialsLeft > 0) then (publishPackage url accessKey (trialsLeft-1) packageFile) + if (trialsLeft > 0) then (publishPackage url apiKey (trialsLeft-1) packageFile) else raise exn let shouldPushNugetPackages = hasBuildParam "nugetkey" - let shouldPushSymbolsPackages = (hasBuildParam "symbolspublishurl") && (hasBuildParam "symbolskey") - if (shouldPushNugetPackages || shouldPushSymbolsPackages) then + if (shouldPushNugetPackages) then printfn "Pushing nuget packages" if shouldPushNugetPackages then let normalPackages= !! (outputNuGet @@ "*.nupkg") |> Seq.sortBy(fun x -> x.ToLower()) @@ -502,14 +500,6 @@ Target "PublishNuget" (fun _ -> publishPackage (getBuildParamOrDefault "nugetpublishurl" "https://api.nuget.org/v3/index.json") (getBuildParam "nugetkey") 3 package with exn -> printfn "%s" exn.Message - - if shouldPushSymbolsPackages then - let symbolPackages= !! (outputNuGet @@ "*.snupkg") |> Seq.sortBy(fun x -> x.ToLower()) - for package in symbolPackages do - try - publishPackage (getBuildParam "symbolspublishurl") (getBuildParam "symbolskey") 3 package - with exn -> - printfn "%s" exn.Message ) //--------------------------------------------------------------------------------