Skip to content

Commit 8ffc5a8

Browse files
committed
Update release machinery
1 parent 48e70c9 commit 8ffc5a8

File tree

3 files changed

+35
-16
lines changed

3 files changed

+35
-16
lines changed

build.fsx

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
open Fake
44
open Fake.Git
55
open Fake.ReleaseNotesHelper
6+
open Fake.UserInputHelper
67
open Fake.ZipHelper
78
open Fake.AssemblyInfoFile
89
open System
910
open System.IO
1011
open System.Text.RegularExpressions
1112

13+
let githubOrg = "fsharp"
1214
let project = "FsAutoComplete"
1315
let summary = "A command line tool for interfacing with FSharp.Compiler.Service over a pipe."
1416

@@ -95,16 +97,26 @@ Target "ReleaseArchive" (fun _ ->
9597
++ (buildReleaseDir + "/*.exe"))
9698
)
9799

98-
Target "ReleaseInstructions"
99-
(fun _ ->
100-
printfn "Go to https://github.com/fsharp/FsAutoComplete/releases/new"
101-
printfn "Enter the following information:\n"
102-
printfn "\tTag version: %s" release.AssemblyVersion
103-
printfn "\tRelease title: %s" release.AssemblyVersion
104-
printfn "\tNotes:\n"
105-
for note in release.Notes do
106-
printfn "%s" note
107-
printfn "\n\nAttach the archive '%s'" releaseArchive
100+
#load "lib/Octokit.fsx"
101+
open Octokit
102+
103+
Target "Release" (fun _ ->
104+
let user = getUserInput "Username: "
105+
let pw = getUserPassword "Password: "
106+
107+
StageAll ""
108+
Git.Commit.Commit "" (sprintf "Bump version to %s" release.NugetVersion)
109+
Branches.push ""
110+
111+
Branches.tag "" release.NugetVersion
112+
Branches.pushTag "" "origin" release.NugetVersion
113+
114+
// release on github
115+
createClient user pw
116+
|> createDraft githubOrg project release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes
117+
|> uploadFile releaseArchive
118+
|> releaseDraft
119+
|> Async.RunSynchronously
108120
)
109121

110122
Target "Clean" (fun _ ->
@@ -115,7 +127,6 @@ Target "Clean" (fun _ ->
115127
Target "Build" id
116128
Target "Test" id
117129
Target "All" id
118-
Target "Release" id
119130

120131
"BuildDebug"
121132
==> "Build"
@@ -134,7 +145,6 @@ Target "Release" id
134145
"AssemblyInfo"
135146
==> "BuildRelease"
136147
==> "ReleaseArchive"
137-
==> "ReleaseInstructions"
138148
==> "Release"
139149

140150
RunTargetOrDefault "BuildDebug"

paket.dependencies

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ nuget Newtonsoft.Json
77
nuget FAKE
88
nuget FSharp.Core 3.0.2
99
nuget NUnit
10-
nuget NUnit.Runners
10+
nuget NUnit.Runners
11+
nuget Octokit

paket.lock

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
NUGET
22
remote: https://www.nuget.org/api/v2
33
specs:
4-
FAKE (3.35.1)
5-
FSharp.Compiler.Service (0.0.90) - framework: >= net45
4+
FAKE (4.0.2)
5+
FSharp.Compiler.Service (1.3.1.0) - framework: >= net45
66
FSharp.Core (3.0.2)
7+
Microsoft.Bcl (1.1.10)
8+
Microsoft.Bcl.Build (>= 1.0.14)
9+
Microsoft.Bcl.Build (1.0.21)
10+
Microsoft.Net.Http (2.2.29)
11+
Microsoft.Bcl (>= 1.1.10)
12+
Microsoft.Bcl.Build (>= 1.0.14)
713
Mono.Cecil (0.9.6.1)
814
NDesk.Options (0.2.1)
9-
Newtonsoft.Json (6.0.8)
15+
Newtonsoft.Json (7.0.1)
1016
NUnit (2.6.4)
1117
NUnit.Runners (2.6.4)
18+
Octokit (0.14.0)
19+
Microsoft.Net.Http

0 commit comments

Comments
 (0)