@@ -59,6 +59,8 @@ open Fake.Core.TargetOperators
5959open System.Net .Http
6060open Microsoft.Deployment .DotNet .Releases
6161open Fake.JavaScript
62+ open Octokit
63+ open Octokit.Internal
6264
6365// ****************************************************************************************************
6466// ------------------------------------------- Definitions -------------------------------------------
@@ -1011,12 +1013,6 @@ Target.create "GitHubRelease" (fun _ ->
10111013 Git.CommandHelper.directRunGitCommandAndFail gitDirectory
" config user.email [email protected] " 10121014 Git.CommandHelper.directRunGitCommandAndFail gitDirectory " config user.name \" Matthias Dittrich\" "
10131015
1014- // Git.Staging.stageAll gitDirectory
1015- // Git.Commit.exec gitDirectory (sprintf "Bump version to %s" simpleVersion)
1016- // let branch = "bump-version-to-" + simpleVersion
1017- // Git.Branches.checkoutNewBranch gitDirectory "origin" branch
1018- // Git.Branches.pushBranch gitDirectory "origin" branch
1019-
10201016 Git.Branches.tag gitDirectory simpleVersion
10211017 Git.Branches.pushTag gitDirectory url simpleVersion
10221018
@@ -1033,7 +1029,24 @@ Target.create "GitHubRelease" (fun _ ->
10331029 |> GitHub.draftNewRelease githubReleaseUser gitName simpleVersion ( release.SemVer.PreRelease <> None) release.Notes
10341030 |> GitHub.uploadFiles files
10351031 |> GitHub.publishDraft
1036- |> Async.RunSynchronously)
1032+ |> Async.RunSynchronously
1033+
1034+ let bumpVersionMessage = ( sprintf " Bump version to %s " simpleVersion)
1035+ let branch = " bump-version-to-" + simpleVersion
1036+ Git.Staging.stageAll " .config"
1037+ Git.Commit.exec gitDirectory bumpVersionMessage
1038+ Git.Branches.checkoutNewBranch gitDirectory " master" branch
1039+ Git.Branches.pushBranch gitDirectory " origin" branch
1040+
1041+ // when we release the GitHub module, this will be replaced with GitHub.createPullRequest API
1042+ let pullRequest = new NewPullRequest( bumpVersionMessage, branch, " master" )
1043+ let pullRequestTask ( client : GitHubClient ) =
1044+ client.PullRequest.Create( githubReleaseUser, gitName, pullRequest) |> Async.AwaitTask |> Async.RunSynchronously
1045+
1046+ GitHub.createClientWithToken token
1047+ |> Async.RunSynchronously
1048+ |> pullRequestTask
1049+ |> ignore)
10371050
10381051// ----------------------------------------------------------------------------------------------------
10391052// Artifact targets; Preparing artifacts for release from existing artifacts
0 commit comments