Skip to content

Commit

Permalink
Merge pull request #200 from rneatherway/release-updates
Browse files Browse the repository at this point in the history
Prompt for username/password, and choose remote
  • Loading branch information
pblasucci committed Aug 4, 2015
2 parents 49b1e69 + 792757e commit ef7d3d2
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions build.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ open Fake
open Fake.Git
open Fake.AssemblyInfoFile
open Fake.ReleaseNotesHelper
open Fake.UserInputHelper
open System
open System.IO
#if MONO
Expand Down Expand Up @@ -297,15 +298,29 @@ Target "ReleaseDocs" (fun _ ->
open Octokit

Target "Release" (fun _ ->
let user =
match getBuildParam "github-user" with
| s when not (String.IsNullOrWhiteSpace s) -> s
| _ -> getUserInput "Username: "
let pw =
match getBuildParam "github-pw" with
| s when not (String.IsNullOrWhiteSpace s) -> s
| _ -> getUserPassword "Password: "
let remote =
Git.CommandHelper.getGitResult "" "remote -v"
|> Seq.filter (fun (s: string) -> s.EndsWith("(push)"))
|> Seq.tryFind (fun (s: string) -> s.Contains(gitOwner + "/" + gitName))
|> function None -> gitHome + "/" + gitName | Some (s: string) -> s.Split().[0]

StageAll ""
Git.Commit.Commit "" (sprintf "Bump version to %s" release.NugetVersion)
Branches.push ""
Branches.pushBranch "" remote (Information.getBranchName "")

Branches.tag "" release.NugetVersion
Branches.pushTag "" "origin" release.NugetVersion
Branches.pushTag "" remote release.NugetVersion

// release on github
createClient (getBuildParamOrDefault "github-user" "") (getBuildParamOrDefault "github-pw" "")
createClient user pw
|> createDraft gitOwner gitName release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes
// TODO: |> uploadFile "PATH_TO_FILE"
|> releaseDraft
Expand Down

0 comments on commit ef7d3d2

Please sign in to comment.