Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathReleaseTasks.fs
More file actions
Latest commit
168 lines (133 loc) · 4.7 KB
/
Copy pathReleaseTasks.fs
File metadata and controls
168 lines (133 loc) · 4.7 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
module ReleaseTasks
openMessagePrompts
openProjectInfo
openBasicTasks
openTestTasks
openPackageTasks
openDocumentationTasks
openBlackFox.Fake
openFake.Core
openFake.DotNet
openFake.Api
openFake.Tools
openFake.IO
openFake.IO.Globbing.Operators
letcreateTag=
BuildTask.create "CreateTag"[ clean; build; runTestsAll; pack ]{
if promptYesNo (sprintf "tagging branch with %s OK?" branchTag)then
Git.Branches.tag "" branchTag
Git.Branches.pushTag "" projectRepo branchTag
else
failwith "aborted"
}
letcreatePrereleaseTag=
BuildTask.create
"CreatePrereleaseTag"
[
setPrereleaseTag
clean
build
runTestsAll
packPrerelease
]{
if promptYesNo (sprintf "tagging branch with %s OK?" prereleaseTag)then
Git.Branches.tag "" prereleaseTag
Git.Branches.pushTag "" projectRepo prereleaseTag
else
failwith "aborted"
}
letpublishNuget=
BuildTask.create "PublishNuget"[ clean; build; runTestsAll; pack ]{
lettargets=
(!!(sprintf "%s/*.*pkg" pkgDir))
printfn "package files:"
for target in targets do
printfn "%A" target
printfn "package versions to release:"
projects
|> List.iter (fun p ->
printfn $"{p.Name} @ {p.PackageVersionTag}"
)
if promptYesNo "OK?"then
letsource=
"https://api.nuget.org/v3/index.json"
letapikey=
Environment.environVar "NUGET_KEY"
for artifact in targets do
letresult=
DotNet.exec id "nuget"(sprintf "push -s %s -k %s%s --skip-duplicate" source apikey artifact)
ifnot result.OK then
failwith "failed to push packages"
else
failwith "aborted"
}
letpublishNugetPrerelease=
BuildTask.create
"PublishNugetPrerelease"
[
clean
build
runTestsAll
packPrerelease
]{
lettargets=
(!!(sprintf "%s/*.*pkg" pkgDir))
printfn "package files:"
for target in targets do
printfn "%A" target
printfn "package versions to release:"
projects
|> List.iter (fun p ->
printfn $"{p.Name} @ {p.PackagePrereleaseTag}"
)
if promptYesNo "OK?"then
letsource=
"https://api.nuget.org/v3/index.json"
letapikey=
Environment.environVar "NUGET_KEY"
for artifact in targets do
letresult=
DotNet.exec id "nuget"(sprintf "push -s %s -k %s%s --skip-duplicate" source apikey artifact)
ifnot result.OK then
failwith "failed to push packages"
else
failwith "aborted"
}
letreleaseDocs=
BuildTask.create "ReleaseDocs"[ buildDocs ]{
letmsg=
sprintf "release docs for version %s?" stableDocsVersionTag
if promptYesNo msg then
Shell.cleanDir "temp"
Git.CommandHelper.runSimpleGitCommand
"."
(sprintf "clone %s temp/gh-pages --depth 1 -b gh-pages" projectRepo)
|> ignore
Shell.copyRecursive "output""temp/gh-pages"true|> printfn "%A"
Git.CommandHelper.runSimpleGitCommand "temp/gh-pages""add ."|> printfn "%s"
letcmd=
sprintf """commit -a -m "Update generated documentation for version %s""" stableDocsVersionTag
Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" cmd |> printfn "%s"
Git.Branches.push "temp/gh-pages"
else
failwith "aborted"
}
letprereleaseDocs=
BuildTask.create "PrereleaseDocs"[ buildDocsPrerelease ]{
letmsg=
sprintf "release docs for version %s?" prereleaseTag
if promptYesNo msg then
Shell.cleanDir "temp"
Git.CommandHelper.runSimpleGitCommand
"."
(sprintf "clone %s temp/gh-pages --depth 1 -b gh-pages" projectRepo)
|> ignore
Shell.copyRecursive "output""temp/gh-pages"true|> printfn "%A"
Git.CommandHelper.runSimpleGitCommand "temp/gh-pages""add ."|> printfn "%s"
letcmd=
sprintf """commit -a -m "Update generated documentation for version %s""" prereleaseTag
Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" cmd |> printfn "%s"
Git.Branches.push "temp/gh-pages"
else
failwith "aborted"
}