Skip to content

Commit 2e1403b

Browse files
committed
Merge pull request #55 from rneatherway/release-select-remote
Automatically find correct remote to push tag to
2 parents 4e7d219 + 0785f87 commit 2e1403b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

build.fsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,19 @@ open Octokit
103103
Target "Release" (fun _ ->
104104
let user = getUserInput "Username: "
105105
let pw = getUserPassword "Password: "
106+
let remote =
107+
Git.CommandHelper.getGitResult "" "remote -v"
108+
|> Seq.filter (fun (s: string) -> s.EndsWith("(push)"))
109+
|> Seq.tryFind (fun (s: string) -> s.Contains(githubOrg + "/" + project))
110+
|> function None -> "https://github.com/" + githubOrg + "/" + project
111+
| Some (s: string) -> s.Split().[0]
106112

107113
StageAll ""
108114
Git.Commit.Commit "" (sprintf "Bump version to %s" release.NugetVersion)
109-
Branches.push ""
115+
Branches.pushBranch "" remote (Information.getBranchName "")
110116

111117
Branches.tag "" release.NugetVersion
112-
Branches.pushTag "" "origin" release.NugetVersion
118+
Branches.pushTag "" remote release.NugetVersion
113119

114120
// release on github
115121
createClient user pw

0 commit comments

Comments
 (0)