From 595a5a8cdef32ad2b3558f0b129f4b54068192fa Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Tue, 28 Jan 2020 15:45:57 -0600 Subject: [PATCH] modified build script so if there's a beta version in the release notes, that ges automatically included in the NuGet package metadata (#4175) --- build.fsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/build.fsx b/build.fsx index 52b5dbb502d..9ccc4f5ed88 100644 --- a/build.fsx +++ b/build.fsx @@ -30,15 +30,22 @@ let outputBinariesNetStandard = outputBinaries @@ "netstandard1.6" 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 releaseNotes = + 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 - -let releaseNotes = - File.ReadLines "./RELEASE_NOTES.md" - |> ReleaseNotesHelper.parseReleaseNotes + // Incremental builds let runIncrementally = hasBuildParam "incremental"