This repository has been archived by the owner on Sep 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.fsx
60 lines (46 loc) · 1.8 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
// --------------------------------------------------------------------------------------
// FAKE build script
// --------------------------------------------------------------------------------------
#I "packages/FAKE/tools"
#r "FakeLib.dll"
open System
open System.IO
open Fake
open Fake.Git
// Git configuration (used for publishing documentation in gh-pages branch)
// The profile where the project is posted
let gitHome = "https://github.com/panesofglass"
// The name of the project on GitHub
let gitName = "TodoBackendFSharp"
// --------------------------------------------------------------------------------------
// Clean build results & restore NuGet packages
Target "Clean" (fun _ ->
CleanDirs ["temp";"docs/output"]
)
Target "RestorePackages" RestorePackages
// --------------------------------------------------------------------------------------
// Generate the documentation
Target "Generate" (fun _ ->
if not <| executeFSIWithArgs "" "docs/generate.fsx" [] [] then
failwith "generating slides failed"
)
// --------------------------------------------------------------------------------------
// Release Scripts
Target "Publish" (fun _ ->
let tempDocsDir = "temp/gh-pages"
CleanDir tempDocsDir
Repository.cloneSingleBranch "" (gitHome + "/" + gitName + ".git") "gh-pages" tempDocsDir
CopyRecursive "docs/output" tempDocsDir true |> tracefn "%A"
StageAll tempDocsDir
Commit tempDocsDir "Update slides"
Branches.push tempDocsDir
)
// --------------------------------------------------------------------------------------
// Run all targets by default. Invoke 'build <Target>' to override
Target "All" DoNothing
"Clean"
==> "RestorePackages"
=?> ("Generate",isLocalBuild && not isMono)
=?> ("Publish",isLocalBuild && not isMono)
==> "All"
RunTargetOrDefault "All"