From 4f04f73309201a4db5cad1378d48e6c7c0efe370 Mon Sep 17 00:00:00 2001 From: Daniel Valadas Date: Thu, 12 Aug 2021 16:45:14 -0400 Subject: [PATCH] Semi-automates versioning This will make the version default to the last git tag, so v1.9.10 will produce version 1.9.10 of the package --- Build-Release.ps1 | 9 +++++++-- README.md | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Build-Release.ps1 b/Build-Release.ps1 index 068f02b..d1706d2 100644 --- a/Build-Release.ps1 +++ b/Build-Release.ps1 @@ -1,9 +1,9 @@ param ( - [Parameter(Mandatory=$true)] + [Parameter(Mandatory=$false)] [ValidatePattern("^\d+\.\d+\.(?:\d+\.\d+$|\d+$)")] [string] $ReleaseVersionNumber, - [Parameter(Mandatory=$true)] + [Parameter(Mandatory=$false)] [string] [AllowEmptyString()] $PreReleaseName, @@ -12,6 +12,11 @@ param ( $IsBuildServer = 0 ) +if ([string]::IsNullOrEmpty($ReleaseVersionNumber)) { + $tags = git tag --sort=-creatordate + $ReleaseVersionNumber = $tags[0].Substring(1); +} + $PSScriptFilePath = (Get-Item $MyInvocation.MyCommand.Path).FullName $RepoRoot = (get-item $PSScriptFilePath).Directory.FullName; $SolutionRoot = Join-Path -Path $RepoRoot -ChildPath "src"; diff --git a/README.md b/README.md index b36a133..2966a32 100644 --- a/README.md +++ b/README.md @@ -61,3 +61,6 @@ Shows information about all CDF releases © 2018 by Shannon Deminick This is free software and is licensed under the [Microsoft Public License (Ms-PL)](http://opensource.org/licenses/MS-PL) + +## Build/Release process +To build the DNN specific library, run `./Build-Release.ps1` in powershell. The default configuration will use the version from the most recent git tag only if a specific version is not provided manually to the script. \ No newline at end of file