Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chocolatey package structure update #1613

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -854,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")
Expand Down Expand Up @@ -1047,11 +1050,11 @@ 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"
==> "PublishNuget"
Expand Down
2 changes: 1 addition & 1 deletion src/Fake-choco-template.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ If you need more than the default functionality you can either write F# or simpl
@dependencies@
</metadata>
@files@
<!--<file src="..\nuget\dotnetcore\Fake.netcore\win7-x86\**" target="bin" />-->
<!--<file src="..\nuget\legacy\tools\**" target="tools" />-->
</package>