-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.fsx
95 lines (72 loc) · 2.03 KB
/
build.fsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#r @"packages/build/FAKE/tools/FakeLib.dll"
open Fake
open Fake.Git
open Fake.AssemblyInfoFile
open Fake.ReleaseNotesHelper
open System
open System.IO
let project = "Data.HList"
let testAssemblies = "test/**/bin/Release/net45/*Tests*.dll"
let outDir = currentDirectory @@ "bin"
let gitOwner = "pocketberserker"
let gitHome = "https://github.com/" + gitOwner
let gitName = "Data.HList"
let gitRaw = environVarOrDefault "gitRaw" "https://raw.github.com/pocketberserker"
let release = LoadReleaseNotes "RELEASE_NOTES.md"
Target "Clean" (fun _ ->
CleanDirs ["bin"]
)
Target "Build" (fun _ ->
DotNetCli.Restore id
DotNetCli.Build (fun p -> { p with Project = "./src/CSharp.Data.HList" })
DotNetCli.Build (fun p -> { p with Project = "./src/FSharp.Data.HList" })
)
Target "RunTests" (fun _ ->
DotNetCli.Test (fun p -> { p with Project = "./test/FSharp.Data.HList.Tests" })
)
Target "NuGet" (fun _ ->
DotNetCli.Pack (fun p ->
{ p with
Project = "./src/CSharp.Data.HList"
OutputPath = outDir
}
)
DotNetCli.Pack (fun p ->
{ p with
Project = "./src/FSharp.Data.HList"
OutputPath = outDir
}
)
)
Target "PublishNuget" (fun _ ->
Paket.Push(fun p ->
{ p with
WorkingDir = outDir })
)
#load "paket-files/build/fsharp/FAKE/modules/Octokit/Octokit.fsx"
open Octokit
Target "Release" (fun _ ->
StageAll ""
Git.Commit.Commit "" (sprintf "Bump version to %s" release.NugetVersion)
Branches.push ""
Branches.tag "" release.NugetVersion
Branches.pushTag "" "origin" release.NugetVersion
// release on github
createClient (getBuildParamOrDefault "github-user" "") (getBuildParamOrDefault "github-pw" "")
|> createDraft gitOwner gitName release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes
|> releaseDraft
|> Async.RunSynchronously
)
Target "BuildPackage" DoNothing
Target "All" DoNothing
"Clean"
==> "Build"
==> "RunTests"
==> "All"
"All"
==> "NuGet"
==> "BuildPackage"
"BuildPackage"
==> "PublishNuget"
==> "Release"
RunTargetOrDefault "All"