-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.fsx
71 lines (55 loc) · 1.83 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
#r "nuget: Fun.Build, 1.0.5"
#r "nuget: Fake.DotNet.AssemblyInfoFile"
#r "nuget: Fake.DotNet.Paket"
open Fun.Build
open Fake.IO
open Fake.DotNet
let version =
Changelog.GetLastVersion(__SOURCE_DIRECTORY__)
|> Option.defaultWith (fun () -> failwith "Version is not found")
pipeline "build" {
workingDir __SOURCE_DIRECTORY__
runBeforeEachStage (fun ctx ->
if ctx.GetStageLevel() = 0 then
printfn $"::group::{ctx.Name}")
runAfterEachStage (fun ctx ->
if ctx.GetStageLevel() = 0 then
printfn "::endgroup::")
stage "Check environment" {
run "dotnet tool restore"
run "dotnet paket restore"
}
stage "Check Formatting" {
run "dotnet csharpier --check ."
}
stage "Clean" {
run (fun _ ->
Shell.mkdir "bin"
Shell.cleanDir "bin")
run "dotnet clean"
}
stage "AssemblyInfo" {
run (fun _ ->
let fileName = "Clippit/Properties/AssemblyInfo.Generated.cs"
AssemblyInfoFile.createCSharp
fileName
[ AssemblyInfo.Title "Clippit"
AssemblyInfo.Product "Clippit"
AssemblyInfo.Description "Fresh PowerTools for OpenXml"
AssemblyInfo.Version version.Version
AssemblyInfo.FileVersion version.Version ])
}
stage "Build" { run "dotnet build Clippit.sln -c Release" }
stage "RunTests" { run "dotnet test Clippit.Tests/" }
stage "NuGet" {
run (fun _ ->
Paket.pack (fun p ->
{ p with
ToolType = ToolType.CreateLocalTool()
OutputPath = "bin"
Version = version.Version
ReleaseNotes = version.ReleaseNotes }))
}
runIfOnlySpecified
}
tryPrintPipelineCommandHelp ()