From 94843bc8b9e3eca9bf9d30732a7c2f347fbe91bb Mon Sep 17 00:00:00 2001 From: Volodymyr Lukashevych Date: Tue, 11 Jul 2017 02:21:52 -0700 Subject: [PATCH 1/2] Add targets for the 'legacy' FAKE Chocolatey package CreateChocolateyPackage and PushChocolateyPackage targets are created for FAKE Chocolatey package. --- build.fsx | 26 ++++++++++++++++++++++++++ src/Fake-choco-template.nuspec | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/build.fsx b/build.fsx index 1df35655bc4..67a6e5f6c8e 100644 --- a/build.fsx +++ b/build.fsx @@ -688,6 +688,30 @@ Target "CreateNuGet" (fun _ -> NuGet (setParams >> x64ify) "fake.nuspec" ) +Target "CreateChocolateyPackage" (fun _ -> + let nugetToolsDir = nugetLegacyDir @@ "tools" + CleanDir nugetToolsDir + !! (buildDir @@ "**/*.*") |> Copy nugetToolsDir + + ensureDirectory "nuget/legacy/chocolatey" + Choco.PackFromTemplate (fun p -> + { p with + PackageId = "fake" + ReleaseNotes = release.Notes |> toLines + InstallerType = Choco.ChocolateyInstallerType.SelfContained + Version = release.NugetVersion + Files = [ (System.IO.Path.GetFullPath @"nuget\legacy\tools") + @"\**", Some "tools", None ] + OutputDir = "nuget/legacy/chocolatey" }) "src/Fake-choco-template.nuspec" + () +) +Target "PushChocolateyPackage" (fun _ -> + let path = sprintf "nuget/legacy/chocolatey/%s.%s.nupkg" "fake" release.NugetVersion + path |> Choco.Push (fun p -> + { p with + Source = "https://push.chocolatey.org/" + ApiKey = environVarOrFail "CHOCOLATEY_API_KEY" }) +) + #if !DOTNETCORE #load "src/app/Fake.DotNet.Cli/Dotnet.fs" open Fake.DotNet.Cli @@ -1048,10 +1072,12 @@ Target "StartDnc" DoNothing =?> ("CreateNuGet", not isLinux) ==> "CopyLicense" =?> ("DotnetCoreCreateChocolateyPackage", not isLinux) + =?> ("CreateChocolateyPackage", not isLinux) ==> "Default" =?> ("GenerateDocs", isLocalBuild && not isLinux) ==> "EnsureTestsRun" =?> ("DotnetCorePushChocolateyPackage", not isLinux) + =?> ("PushChocolateyPackage", not isLinux) =?> ("ReleaseDocs", isLocalBuild && not isLinux) ==> "DotnetCorePushNuGet" ==> "PublishNuget" diff --git a/src/Fake-choco-template.nuspec b/src/Fake-choco-template.nuspec index 075297e2006..c62bb9a92f0 100644 --- a/src/Fake-choco-template.nuspec +++ b/src/Fake-choco-template.nuspec @@ -26,5 +26,5 @@ If you need more than the default functionality you can either write F# or simpl @dependencies@ @files@ - + From 5a60e97aea270191eee363b3f10db2224e994883 Mon Sep 17 00:00:00 2001 From: Volodymyr Lukashevych Date: Tue, 11 Jul 2017 02:32:13 -0700 Subject: [PATCH 2/2] Remove DotnetCore Chocolatey targets Remove DotnetCoreCreateChocolateyPackage and DotnetCorePushChocolateyPackage targets. Use CreateChocolateyPackage and PushChocolateyPackage instead. --- build.fsx | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/build.fsx b/build.fsx index 67a6e5f6c8e..c32dab7ffe9 100644 --- a/build.fsx +++ b/build.fsx @@ -878,27 +878,6 @@ Target "DotnetCoreCreateZipPackages" (fun _ -> ) ) -Target "DotnetCoreCreateChocolateyPackage" (fun _ -> - // !! "" - ensureDirectory "nuget/dotnetcore/chocolatey" - Choco.PackFromTemplate (fun p -> - { p with - PackageId = "fake" - ReleaseNotes = release.Notes |> toLines - InstallerType = Choco.ChocolateyInstallerType.SelfContained - Version = release.NugetVersion - Files = [ (System.IO.Path.GetFullPath @"nuget\dotnetcore\Fake.netcore\win7-x86") + @"\**", Some "bin", None ] - OutputDir = "nuget/dotnetcore/chocolatey" }) "src/Fake-choco-template.nuspec" - () -) -Target "DotnetCorePushChocolateyPackage" (fun _ -> - let path = sprintf "nuget/dotnetcore/chocolatey/%s.%s.nupkg" "fake" release.NugetVersion - path |> Choco.Push (fun p -> - { p with - Source = "https://push.chocolatey.org/" - ApiKey = environVarOrFail "CHOCOLATEY_API_KEY" }) -) - let executeFPM args = printfn "%s %s" "fpm" args Shell.Exec("fpm", args=args, dir="bin") @@ -1071,12 +1050,10 @@ Target "StartDnc" DoNothing =?> ("SourceLink", isLocalBuild && not isLinux) =?> ("CreateNuGet", not isLinux) ==> "CopyLicense" - =?> ("DotnetCoreCreateChocolateyPackage", not isLinux) =?> ("CreateChocolateyPackage", not isLinux) ==> "Default" =?> ("GenerateDocs", isLocalBuild && not isLinux) ==> "EnsureTestsRun" - =?> ("DotnetCorePushChocolateyPackage", not isLinux) =?> ("PushChocolateyPackage", not isLinux) =?> ("ReleaseDocs", isLocalBuild && not isLinux) ==> "DotnetCorePushNuGet"