Skip to content

Commit

Permalink
added support for creating NuGet VersionSuffix via RELEASE_NOTES.md (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb authored Mar 2, 2020
1 parent 8f2e47a commit 63039f9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,22 @@ let solutionFile = FindFirstMatchingFile "*.sln" __SOURCE_DIRECTORY__ // dynami
let buildNumber = environVarOrDefault "BUILD_NUMBER" "0"
let hasTeamCity = (not (buildNumber = "0")) // check if we have the TeamCity environment variable for build # set
let preReleaseVersionSuffix = "beta" + (if (not (buildNumber = "0")) then (buildNumber) else DateTime.UtcNow.Ticks.ToString())
let versionSuffix =
match (getBuildParam "nugetprerelease") with
| "dev" -> preReleaseVersionSuffix
| _ -> ""

let releaseNotes =
File.ReadLines "./RELEASE_NOTES.md"
File.ReadLines (__SOURCE_DIRECTORY__ @@ "RELEASE_NOTES.md")
|> ReleaseNotesHelper.parseReleaseNotes

let versionFromReleaseNotes =
match releaseNotes.SemVer.PreRelease with
| Some r -> r.Origin
| None -> ""

let versionSuffix =
match (getBuildParam "nugetprerelease") with
| "dev" -> preReleaseVersionSuffix
| "" -> versionFromReleaseNotes
| str -> str

// Directories
let toolsDir = __SOURCE_DIRECTORY__ @@ "tools"
let output = __SOURCE_DIRECTORY__ @@ "bin"
Expand Down

0 comments on commit 63039f9

Please sign in to comment.