Skip to content

Commit

Permalink
Update Directory.Build.props after releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
tachyus-ryan committed Oct 21, 2019
1 parent 773c14c commit b80ac8e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### 2.3.1 - TBD
### 2.3.1 - 21.10.2019
* Update dependency versions for FSharpx.Async and FSharpx.Collections - https://github.com/fsprojects/FSharpx.Extras/issue/370
* Update source linking to use new, dotnet approach - https://github.com/fsprojects/FSharpx.Extras/issue/372
* Added ofOptionF to Result module - https://github.com/fsprojects/FSharpx.Extras/pull/377

### 2.3.0 - 4.8.2019
* New netstandard2.0 support - https://github.com/fsprojects/FSharpx.Extras/pull/360
Expand Down
28 changes: 28 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ open Fake.IO
open Fake.IO.Globbing.Operators
open Fake.Tools
open System
open System.IO
open System.Xml.Linq

// --------------------------------------------------------------------------------------
// START TODO: Provide project-specific details below
Expand Down Expand Up @@ -120,6 +122,29 @@ Target.create "PublishNuget" (fun _ ->
// --------------------------------------------------------------------------------------
// Release Scripts

// Directory.Build.props helpers

let getVersion (versionFile:string) =
let doc = XElement.Load versionFile
let version =
doc.Elements().Elements()
|> Seq.filter (fun e -> e.Name.LocalName = "VersionPrefix")
|> Seq.head
version.Value

let setVersion (versionFile:string) newVersion =
let doc = XElement.Load versionFile
let version =
doc.Elements().Elements()
|> Seq.filter (fun e -> e.Name.LocalName = "VersionPrefix")
|> Seq.head
version.Value <- newVersion
doc.Save versionFile

let nextTag (version:string) =
let lastDot = version.LastIndexOf(".")
version.Substring(lastDot + 1)

Target.create "Release" (fun _ ->
let user =
match Environment.environVarOrDefault "github-user" "" with
Expand All @@ -142,6 +167,9 @@ Target.create "Release" (fun _ ->
Git.Branches.tag "" release.NugetVersion
Git.Branches.pushTag "" remote release.NugetVersion

let versionFile = Path.Combine("src", "Directory.Build.props")
setVersion versionFile (nextTag release.NugetVersion)

// release on github
GitHub.createClient user pw
|> GitHub.draftNewRelease gitOwner gitName release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes
Expand Down

0 comments on commit b80ac8e

Please sign in to comment.