-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.fsx
56 lines (42 loc) · 1.28 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
#r "nuget: FsMake, 0.6.1"
open System
open System.IO
open FsMake
let args = fsi.CommandLineArgs
let root = __SOURCE_DIRECTORY__
let clean =
Step.create "clean" {
try
Directory.Delete($"{root}/dist", true)
with _ ->
()
do! Cmd.createWithArgs "dotnet" [ "clean"; "src"; "-v"; "m" ] |> Cmd.run
}
let restore =
Step.create "restore" { do! Cmd.createWithArgs "dotnet" [ "restore"; "src" ] |> Cmd.run }
let build =
Step.create "build" { do! Cmd.createWithArgs "dotnet" [ "build"; "src"; "--no-restore" ] |> Cmd.run }
let publish =
Step.create "publish" {
do!
Cmd.createWithArgs "dotnet" [ "publish"; "src"; "-o"; "./dist"; "--no-restore" ]
|> Cmd.run
}
let runTestScript =
Step.create "test:unit" {
do!
Cmd.createWithArgs "dotnet" [ "fsi"; "--compilertool:./dist"; "test.fsx" ]
|> Cmd.run
}
Pipelines.create {
let! build =
Pipeline.create "build" {
run clean
run restore
run build
}
let! publish = Pipeline.createFrom build "publish" { run publish }
let! testScript = Pipeline.createFrom publish "test" { run runTestScript }
default_pipeline testScript
}
|> Pipelines.runWithArgsAndExit args