@@ -27,7 +27,9 @@ let description = """
27
27
interactive service that can be used for embedding F# scripting into your applications."""
28
28
let tags = " F# fsharp interactive compiler editor"
29
29
30
- let gitHome = " https://github.com/fsharp"
30
+ let gitOwner = " fsharp"
31
+ let gitHome = " https://github.com/" + gitOwner
32
+
31
33
let gitName = " FSharp.Compiler.Service"
32
34
let gitRaw = environVarOrDefault " gitRaw" " https://raw.githubusercontent.com/fsharp"
33
35
@@ -37,6 +39,8 @@ let netFrameworks = ["v4.0"; "v4.5"]
37
39
// The rest of the code is standard F# build script
38
40
// --------------------------------------------------------------------------------------
39
41
42
+ let buildDir = " bin"
43
+
40
44
// Read release notes & version info from RELEASE_NOTES.md
41
45
let release = LoadReleaseNotes (__ SOURCE_ DIRECTORY__ + " /RELEASE_NOTES.md" )
42
46
let isAppVeyorBuild = buildServer = BuildServer.AppVeyor
@@ -65,10 +69,8 @@ Target "AssemblyInfo" (fun _ ->
65
69
// --------------------------------------------------------------------------------------
66
70
// Clean build results & restore NuGet packages
67
71
68
- Target " RestorePackages" RestorePackages
69
-
70
72
Target " Clean" ( fun _ ->
71
- CleanDirs [ " bin " ]
73
+ CleanDirs [ buildDir ]
72
74
)
73
75
74
76
Target " CleanDocs" ( fun _ ->
@@ -81,7 +83,7 @@ Target "CleanDocs" (fun _ ->
81
83
Target " GenerateFSIStrings" ( fun _ ->
82
84
// Generate FSIStrings using the FSSrGen tool
83
85
execProcess ( fun p ->
84
- let dir = __ SOURCE_ DIRECTORY__ @@ " src/fsharp/fsi"
86
+ let dir = __ SOURCE_ DIRECTORY__ </> " src/fsharp/fsi"
85
87
p.Arguments <- " FSIstrings.txt FSIstrings.fs FSIstrings.resx"
86
88
p.WorkingDirectory <- dir
87
89
p.FileName <- !! " lib/bootstrap/4.0/fssrgen.exe" |> Seq.head ) TimeSpan.MaxValue
@@ -91,7 +93,7 @@ Target "GenerateFSIStrings" (fun _ ->
91
93
Target " Build" ( fun _ ->
92
94
netFrameworks
93
95
|> List.iter ( fun framework ->
94
- let outputPath = " bin/ " + framework
96
+ let outputPath = buildDir </> framework
95
97
!! ( project + " .sln" )
96
98
|> MSBuild outputPath " Build" [ " Configuration" , " Release" ; " TargetFrameworkVersion" , framework]
97
99
|> Log ( " .NET " + framework + " Build-Output: " ))
@@ -103,7 +105,7 @@ Target "SourceLink" (fun _ ->
103
105
#else
104
106
netFrameworks
105
107
|> List.iter ( fun framework ->
106
- let outputPath = __ SOURCE_ DIRECTORY__ @@ " bin/ " + framework
108
+ let outputPath = __ SOURCE_ DIRECTORY__ </> buildDir </> framework
107
109
let proj = VsProj.Load " src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj"
108
110
[ " Configuration" , " Release" ; " TargetFrameworkVersion" , framework; " OutputPath" , outputPath]
109
111
let sourceFiles =
@@ -140,15 +142,15 @@ Target "RunTests" (fun _ ->
140
142
141
143
Target " NuGet" ( fun _ ->
142
144
NuGet ( fun p ->
143
- { p with
145
+ { p with
144
146
Authors = authors
145
147
Project = project
146
148
Summary = summary
147
149
Description = description
148
150
Version = buildVersion
149
151
ReleaseNotes = release.Notes |> toLines
150
152
Tags = tags
151
- OutputPath = " bin "
153
+ OutputPath = buildDir
152
154
AccessKey = getBuildParamOrDefault " nugetkey" " "
153
155
Publish = hasBuildParam " nugetkey" })
154
156
( " nuget/" + project + " .nuspec" )
@@ -180,7 +182,23 @@ Target "ReleaseDocs" (fun _ ->
180
182
Branches.push " temp/gh-pages"
181
183
)
182
184
183
- Target " Release" DoNothing
185
+ #load " paket-files/fsharp/FAKE/modules/Octokit/Octokit.fsx"
186
+ open Octokit
187
+
188
+ Target " Release" ( fun _ ->
189
+ StageAll " "
190
+ Git.Commit.Commit " " ( sprintf " Bump version to %s " release.NugetVersion)
191
+ Branches.push " "
192
+
193
+ Branches.tag " " release.NugetVersion
194
+ Branches.pushTag " " " origin" release.NugetVersion
195
+
196
+ // release on github
197
+ createClient ( getBuildParamOrDefault " github-user" " " ) ( getBuildParamOrDefault " github-pw" " " )
198
+ |> createDraft gitOwner gitName release.NugetVersion ( release.SemVer.PreRelease <> None) release.Notes
199
+ |> releaseDraft
200
+ |> Async.RunSynchronously
201
+ )
184
202
185
203
// --------------------------------------------------------------------------------------
186
204
// Run all targets by default. Invoke 'build <Target>' to override
@@ -191,7 +209,6 @@ Target "All" DoNothing
191
209
192
210
" Clean"
193
211
=?> ( " BuildVersion" , isAppVeyorBuild)
194
- ==> " RestorePackages"
195
212
==> " AssemblyInfo"
196
213
==> " GenerateFSIStrings"
197
214
==> " Prepare"
0 commit comments