Fix artifact build and ensure the version of future templates are also updated
This commit is contained in:
@@ -396,42 +396,25 @@ stages:
|
||||
|
||||
$ubuild = build/build.ps1 -get -continue
|
||||
|
||||
|
||||
$version = $ubuild.GetUmbracoVersion()
|
||||
|
||||
$isRelease = [regex]::matches($env:BUILD_SOURCEBRANCH,"v\d+\/\d+.\d+.*")
|
||||
|
||||
if ($isRelease.Count -gt 0){
|
||||
if ($isRelease.Count -gt 0) {
|
||||
$continuous = $version.Semver
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$date = (Get-Date).ToString("yyyyMMdd")
|
||||
$continuous = "$($version.release)-preview$date.$(Build.BuildId)"
|
||||
$ubuild.SetUmbracoVersion($continuous)
|
||||
|
||||
#Update the version in templates also
|
||||
|
||||
$templatePath =
|
||||
'build/templates/UmbracoProject/.template.config/template.json'
|
||||
|
||||
$a = Get-Content $templatePath -raw | ConvertFrom-Json
|
||||
|
||||
$a.symbols.version.defaultValue = $continuous
|
||||
|
||||
$a | ConvertTo-Json -depth 32| set-content $templatePath
|
||||
|
||||
|
||||
$templatePath =
|
||||
'build/templates/UmbracoPackage/.template.config/template.json'
|
||||
|
||||
$a = Get-Content $templatePath -raw | ConvertFrom-Json
|
||||
|
||||
$a.symbols.version.defaultValue = $continuous
|
||||
|
||||
$a | ConvertTo-Json -depth 32| set-content $templatePath
|
||||
}
|
||||
# Update the version in templates
|
||||
$templatePaths = Get-ChildItem 'templates/**/.template.config/template.json'
|
||||
foreach ($templatePath in $templatePaths) {
|
||||
$a = Get-Content $templatePath -Raw | ConvertFrom-Json
|
||||
$a.symbols.version.defaultValue = $continuous
|
||||
$a | ConvertTo-Json -Depth 32 | Set-Content $templatePath
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "##vso[build.updatebuildnumber]$continuous.$(Build.BuildId)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user