diff --git a/build.fsx b/build.fsx index 802539c10..31bdbae91 100644 --- a/build.fsx +++ b/build.fsx @@ -3,12 +3,14 @@ open Fake open Fake.Git open Fake.ReleaseNotesHelper +open Fake.UserInputHelper open Fake.ZipHelper open Fake.AssemblyInfoFile open System open System.IO open System.Text.RegularExpressions +let githubOrg = "fsharp" let project = "FsAutoComplete" let summary = "A command line tool for interfacing with FSharp.Compiler.Service over a pipe." @@ -95,16 +97,26 @@ Target "ReleaseArchive" (fun _ -> ++ (buildReleaseDir + "/*.exe")) ) -Target "ReleaseInstructions" - (fun _ -> - printfn "Go to https://github.com/fsharp/FsAutoComplete/releases/new" - printfn "Enter the following information:\n" - printfn "\tTag version: %s" release.AssemblyVersion - printfn "\tRelease title: %s" release.AssemblyVersion - printfn "\tNotes:\n" - for note in release.Notes do - printfn "%s" note - printfn "\n\nAttach the archive '%s'" releaseArchive +#load "lib/Octokit.fsx" +open Octokit + +Target "Release" (fun _ -> + let user = getUserInput "Username: " + let pw = getUserPassword "Password: " + + StageAll "" + Git.Commit.Commit "" (sprintf "Bump version to %s" release.NugetVersion) + Branches.push "" + + Branches.tag "" release.NugetVersion + Branches.pushTag "" "origin" release.NugetVersion + + // release on github + createClient user pw + |> createDraft githubOrg project release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes + |> uploadFile releaseArchive + |> releaseDraft + |> Async.RunSynchronously ) Target "Clean" (fun _ -> @@ -115,7 +127,6 @@ Target "Clean" (fun _ -> Target "Build" id Target "Test" id Target "All" id -Target "Release" id "BuildDebug" ==> "Build" @@ -134,7 +145,6 @@ Target "Release" id "AssemblyInfo" ==> "BuildRelease" ==> "ReleaseArchive" - ==> "ReleaseInstructions" ==> "Release" RunTargetOrDefault "BuildDebug" diff --git a/paket.dependencies b/paket.dependencies index 172a0cb7d..260229f6c 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -7,4 +7,5 @@ nuget Newtonsoft.Json nuget FAKE nuget FSharp.Core 3.0.2 nuget NUnit -nuget NUnit.Runners \ No newline at end of file +nuget NUnit.Runners +nuget Octokit \ No newline at end of file diff --git a/paket.lock b/paket.lock index 0c68518c5..550a9af83 100644 --- a/paket.lock +++ b/paket.lock @@ -1,11 +1,19 @@ NUGET remote: https://www.nuget.org/api/v2 specs: - FAKE (3.35.1) - FSharp.Compiler.Service (0.0.90) - framework: >= net45 + FAKE (4.0.2) + FSharp.Compiler.Service (1.3.1.0) - framework: >= net45 FSharp.Core (3.0.2) + Microsoft.Bcl (1.1.10) + Microsoft.Bcl.Build (>= 1.0.14) + Microsoft.Bcl.Build (1.0.21) + Microsoft.Net.Http (2.2.29) + Microsoft.Bcl (>= 1.1.10) + Microsoft.Bcl.Build (>= 1.0.14) Mono.Cecil (0.9.6.1) NDesk.Options (0.2.1) - Newtonsoft.Json (6.0.8) + Newtonsoft.Json (7.0.1) NUnit (2.6.4) NUnit.Runners (2.6.4) + Octokit (0.14.0) + Microsoft.Net.Http