fix: read terminal release version reliably
Some checks failed
ci / verify (push) Has been cancelled
Some checks failed
ci / verify (push) Has been cancelled
This commit is contained in:
parent
df0da37d5c
commit
0f530dc633
1 changed files with 5 additions and 1 deletions
|
|
@ -13,7 +13,11 @@ $outputDirectory = Join-Path $repositoryRoot 'artifacts'
|
||||||
|
|
||||||
if ([string]::IsNullOrWhiteSpace($Version)) {
|
if ([string]::IsNullOrWhiteSpace($Version)) {
|
||||||
[xml]$project = Get-Content -LiteralPath $projectPath -Raw
|
[xml]$project = Get-Content -LiteralPath $projectPath -Raw
|
||||||
$Version = [string]$project.Project.PropertyGroup.Version
|
$versionNode = $project.SelectSingleNode('/Project/PropertyGroup/Version')
|
||||||
|
if ($null -eq $versionNode) {
|
||||||
|
throw "The terminal project does not define a Version property."
|
||||||
|
}
|
||||||
|
$Version = $versionNode.InnerText.Trim()
|
||||||
}
|
}
|
||||||
if ($Version -notmatch '^\d+\.\d+\.\d+$') {
|
if ($Version -notmatch '^\d+\.\d+\.\d+$') {
|
||||||
throw "Version must use MAJOR.MINOR.PATCH format."
|
throw "Version must use MAJOR.MINOR.PATCH format."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue