Skip to content

Commit bf5ac7c

Browse files
author
Jimmy Byrd
committed
create github release on release
1 parent 5be72d6 commit bf5ac7c

File tree

4 files changed

+55
-22
lines changed

4 files changed

+55
-22
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#### 1.3.0-beta005 - May 25, 2020
1+
#### 1.3.0 - May 25, 2020
22

33
- Adds Applicative Support for FSharp 5.0. Credits [Jimmy Byrd](https://github.com/TheAngryByrd) - (https://github.com/demystifyfp/FsToolkit.ErrorHandling/pull/75)
4-
- Reduces required FSharp.Core version to 4.3.4. Credits [Jimmy Byrd](https://github.com/TheAngryByrd) - (https://github.com/demystifyfp/FsToolkit.ErrorHandling/pull/80)
4+
- Reduces required FSharp.Core version to 4.3.4. Credits [Jimmy Byrd](https://github.com/TheAngryByrd) - (https://github.com/demystifyfp/FsToolkit.ErrorHandling/pull/80)
55

66
#### 1.2.6 - Feb 15, 2020
77

build.fsx

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#r "paket: groupref Build //"
22
#load "./.fake/build.fsx/intellisense.fsx"
33

4+
open Fake.Api
45
open Fake.Core
56
open Fake.IO
67
open Fake.DotNet
@@ -18,6 +19,15 @@ let summary = "An opinionated error handling library for F#"
1819
let configuration = "Release"
1920
let solutionFile = "FsToolkit.ErrorHandling.sln"
2021

22+
let gitOwner ="demystifyfp"
23+
24+
let distDir = __SOURCE_DIRECTORY__ @@ "bin"
25+
let distGlob = distDir @@ "*.nupkg"
26+
27+
let githubToken = Environment.environVarOrNone "GITHUB_TOKEN"
28+
Option.iter(TraceSecrets.register "<GITHUB_TOKEN>" )
29+
30+
2131
Target.create "Clean" (fun _ ->
2232
!! "bin"
2333
++ "src/**/bin"
@@ -131,7 +141,7 @@ Target.create "NuGet" (fun _ ->
131141
DotNet.pack(fun p ->
132142
{ p with
133143
// ./bin from the solution root matching the "PublishNuget" target WorkingDir
134-
OutputPath = Some "./bin"
144+
OutputPath = Some distDir
135145
Configuration = DotNet.BuildConfiguration.Release
136146
MSBuildParams = {MSBuild.CliArguments.Create() with
137147
// "/p" (property) arguments to MSBuild.exe
@@ -144,12 +154,13 @@ Target.create "PublishNuget" (fun _ ->
144154
{ p with
145155
ToolType = ToolType.CreateLocalTool()
146156
PublishUrl = "https://www.nuget.org"
147-
WorkingDir = "bin" })
157+
WorkingDir = distDir })
148158
)
149159

150160
let remote = Environment.environVarOrDefault "FSTK_GIT_REMOTE" "origin"
151161

152-
Target.create "Release" (fun _ ->
162+
163+
Target.create "GitRelease"(fun _ ->
153164
Git.Staging.stageAll ""
154165
Git.Commit.exec "" (sprintf "Bump version to %s\n\n%s" release.NugetVersion releaseNotes)
155166
Git.Branches.push ""
@@ -158,6 +169,22 @@ Target.create "Release" (fun _ ->
158169
Git.Branches.pushTag "" remote release.NugetVersion
159170
)
160171

172+
Target.create "GitHubRelease" (fun _ ->
173+
let token =
174+
match githubToken with
175+
| Some s -> s
176+
| _ -> failwith "please set the github_token environment variable to a github personal access token with repo access."
177+
178+
let files = !! distGlob
179+
GitHub.createClientWithToken token
180+
|> GitHub.draftNewRelease gitOwner project release.NugetVersion (release.SemVer.PreRelease <> None) (releaseNotes |> Seq.singleton)
181+
|> GitHub.uploadFiles files
182+
|> GitHub.publishDraft
183+
|> Async.RunSynchronously
184+
)
185+
186+
Target.create "Release" ignore
187+
161188
Target.create "UpdateDocs" (fun _ ->
162189
Git.Staging.stageAll ""
163190
Git.Commit.exec "" "update docs"
@@ -176,6 +203,8 @@ Target.create "UpdateDocs" (fun _ ->
176203
==> "RunFableTests"
177204
==> "NuGet"
178205
==> "PublishNuGet"
206+
==> "GitRelease"
207+
==> "GitHubRelease"
179208
==> "Release"
180209

181210
// *** Start Build ***

paket.dependencies

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ nuget Fake.Core.ReleaseNotes 5.20.0
2525
nuget Fake.DotNet.AssemblyInfoFile 5.20.0
2626
nuget Fake.DotNet.Paket 5.20.0
2727
nuget Fake.DotNet.Testing.Expecto 5.20.0
28-
nuget Fake.Tools.Git ]5.20.0
28+
nuget Fake.Tools.Git 5.20.0
2929
nuget Fake.JavaScript.Npm 5.20.0
30+
nuget Fake.Api.GitHub 5.20.0
3031
nuget Paket.Core 6.0.0-alpha022

paket.lock

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -642,17 +642,20 @@ NUGET
642642
FSharp.Core - restriction: < netstandard1.6
643643
FSharp.Core (>= 4.0.1.7-alpha) - restriction: >= netstandard1.6
644644
NETStandard.Library (>= 1.6) - restriction: >= netstandard1.6
645+
Fake.Api.GitHub (5.20)
646+
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
647+
Octokit (>= 0.47) - restriction: >= netstandard2.0
645648
Fake.Core.CommandLineParsing (5.20) - restriction: >= netstandard2.0
646649
FParsec (>= 1.1.1) - restriction: >= netstandard2.0
647650
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
648651
Fake.Core.Context (5.20) - restriction: >= netstandard2.0
649652
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
650-
Fake.Core.Environment (5.20) - restriction: || (>= net462) (>= netstandard2.0)
653+
Fake.Core.Environment (5.20) - restriction: >= netstandard2.0
651654
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
652655
Fake.Core.FakeVar (5.20) - restriction: >= netstandard2.0
653656
Fake.Core.Context (>= 5.20) - restriction: >= netstandard2.0
654657
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
655-
Fake.Core.Process (5.20) - restriction: || (>= net462) (>= netstandard2.0)
658+
Fake.Core.Process (5.20) - restriction: >= netstandard2.0
656659
Fake.Core.Environment (>= 5.20) - restriction: >= netstandard2.0
657660
Fake.Core.FakeVar (>= 5.20) - restriction: >= netstandard2.0
658661
Fake.Core.String (>= 5.20) - restriction: >= netstandard2.0
@@ -664,9 +667,9 @@ NUGET
664667
Fake.Core.SemVer (>= 5.20) - restriction: >= netstandard2.0
665668
Fake.Core.String (>= 5.20) - restriction: >= netstandard2.0
666669
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
667-
Fake.Core.SemVer (5.20) - restriction: || (>= net462) (>= netstandard2.0)
670+
Fake.Core.SemVer (5.20) - restriction: >= netstandard2.0
668671
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
669-
Fake.Core.String (5.20) - restriction: || (>= net462) (>= netstandard2.0)
672+
Fake.Core.String (5.20) - restriction: >= netstandard2.0
670673
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
671674
Fake.Core.Target (5.20)
672675
Fake.Core.CommandLineParsing (>= 5.20) - restriction: >= netstandard2.0
@@ -681,7 +684,7 @@ NUGET
681684
Fake.Core.Tasks (5.20) - restriction: >= netstandard2.0
682685
Fake.Core.Trace (>= 5.20) - restriction: >= netstandard2.0
683686
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
684-
Fake.Core.Trace (5.20) - restriction: || (>= net462) (>= netstandard2.0)
687+
Fake.Core.Trace (5.20) - restriction: >= netstandard2.0
685688
Fake.Core.Environment (>= 5.20) - restriction: >= netstandard2.0
686689
Fake.Core.FakeVar (>= 5.20) - restriction: >= netstandard2.0
687690
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
@@ -741,7 +744,7 @@ NUGET
741744
Fake.IO.FileSystem (>= 5.20) - restriction: >= netstandard2.0
742745
Fake.Testing.Common (>= 5.20) - restriction: >= netstandard2.0
743746
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
744-
Fake.IO.FileSystem (5.20) - restriction: || (>= net462) (>= netstandard2.0)
747+
Fake.IO.FileSystem (5.20) - restriction: >= netstandard2.0
745748
Fake.Core.String (>= 5.20) - restriction: >= netstandard2.0
746749
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
747750
Fake.JavaScript.Npm (5.20)
@@ -756,15 +759,14 @@ NUGET
756759
Fake.Testing.Common (5.20) - restriction: >= netstandard2.0
757760
Fake.Core.Trace (>= 5.20) - restriction: >= netstandard2.0
758761
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
759-
Fake.Tools.Git (5.19.1)
760-
Fake.Core.Environment (>= 5.19.1) - restriction: || (>= net462) (>= netstandard2.0)
761-
Fake.Core.Process (>= 5.19.1) - restriction: || (>= net462) (>= netstandard2.0)
762-
Fake.Core.SemVer (>= 5.19.1) - restriction: || (>= net462) (>= netstandard2.0)
763-
Fake.Core.String (>= 5.19.1) - restriction: || (>= net462) (>= netstandard2.0)
764-
Fake.Core.Trace (>= 5.19.1) - restriction: || (>= net462) (>= netstandard2.0)
765-
Fake.IO.FileSystem (>= 5.19.1) - restriction: || (>= net462) (>= netstandard2.0)
766-
FSharp.Core (>= 4.7) - restriction: || (>= net462) (>= netstandard2.0)
767-
System.ValueTuple (>= 4.4) - restriction: >= net462
762+
Fake.Tools.Git (5.20)
763+
Fake.Core.Environment (>= 5.20) - restriction: >= netstandard2.0
764+
Fake.Core.Process (>= 5.20) - restriction: >= netstandard2.0
765+
Fake.Core.SemVer (>= 5.20) - restriction: >= netstandard2.0
766+
Fake.Core.String (>= 5.20) - restriction: >= netstandard2.0
767+
Fake.Core.Trace (>= 5.20) - restriction: >= netstandard2.0
768+
Fake.IO.FileSystem (>= 5.20) - restriction: >= netstandard2.0
769+
FSharp.Core (>= 4.7.1) - restriction: >= netstandard2.0
768770
FParsec (1.1.1) - restriction: >= netstandard2.0
769771
FSharp.Core (>= 4.3.4) - restriction: || (>= net45) (>= netstandard2.0)
770772
System.ValueTuple (>= 4.4) - restriction: >= net45
@@ -846,6 +848,7 @@ NUGET
846848
NuGet.Packaging (>= 5.5.1) - restriction: >= netstandard2.0
847849
System.Dynamic.Runtime (>= 4.3) - restriction: && (< net472) (>= netstandard2.0)
848850
NuGet.Versioning (5.5.1) - restriction: >= netstandard2.0
851+
Octokit (0.47) - restriction: >= netstandard2.0
849852
Paket.Core (6.0.0-alpha022)
850853
Chessie (>= 0.6) - restriction: || (>= net461) (>= netstandard2.0)
851854
FSharp.Core (> 4.3) - restriction: || (>= net461) (>= netstandard2.0)
@@ -1327,7 +1330,7 @@ NUGET
13271330
System.Threading.ThreadPool (4.3) - restriction: && (< monoandroid) (< net46) (< netcoreapp5.0) (>= netstandard2.0) (< xamarinios) (< xamarinmac)
13281331
System.Runtime (>= 4.3) - restriction: && (< monoandroid) (< monotouch) (< net46) (< netcoreapp5.0) (>= netstandard1.3) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)
13291332
System.Runtime.Handles (>= 4.3) - restriction: && (< monoandroid) (< monotouch) (< net46) (< netcoreapp5.0) (>= netstandard1.3) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)
1330-
System.ValueTuple (4.5) - restriction: || (&& (>= net45) (>= netstandard2.0)) (&& (>= net46) (>= netstandard2.0)) (>= net462) (&& (>= netstandard2.0) (>= uap10.0))
1333+
System.ValueTuple (4.5) - restriction: || (&& (>= net45) (>= netstandard2.0)) (&& (>= net46) (>= netstandard2.0)) (&& (>= netstandard2.0) (>= uap10.0))
13311334

13321335
GROUP Test
13331336
STORAGE: NONE

0 commit comments

Comments
 (0)