Update version and artifact name generated by azure pipeline (#10277)
* Update version and artifact name generated by azure pipeline * Fix issue with version * Add build tags * test nightly builds * fix negation + Prefix with Umbraco * use updatereleasename instead * test if build number is the issue * determine releases by tags * use date and rev instead of build nuber * build id * more testing * more test * more test * build without buildId if ResourceTrigger is reason * more test * more trials * determine build type from source branch regex * test * test * test * test * test * test * test * use date in nightlies/previews * use date in nightlies/previews * addd build id to nightlies
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
|
||||
variables:
|
||||
buildConfiguration: Release
|
||||
SA_PASSWORD: UmbracoIntegration123!
|
||||
@@ -321,8 +322,7 @@ stages:
|
||||
restoreSolution: '*\src\umbraco.sln'
|
||||
feedsToUse: config
|
||||
- task: PowerShell@1
|
||||
displayName: Update Version
|
||||
condition: 'eq(variables[''Umbraco.IsReleaseBuild''], ''false'')'
|
||||
displayName: Update Version and Artifact Name
|
||||
inputs:
|
||||
scriptType: inlineScript
|
||||
inlineScript: >
|
||||
@@ -333,40 +333,45 @@ stages:
|
||||
|
||||
$version = $ubuild.GetUmbracoVersion()
|
||||
|
||||
if ($version.Comment -ne "")
|
||||
{
|
||||
# 8.0.0-beta.33.1234
|
||||
$continuous = "$($version.Semver).$(Build.BuildNumber)"
|
||||
$isRelease = [regex]::matches($env:BUILD_SOURCEBRANCH,"v\d+\/\d+.\d+.*")
|
||||
|
||||
|
||||
if ($isRelease.Count -gt 0){
|
||||
$continuous = $version.Semver
|
||||
Write-Host "##vso[build.addbuildtag]Release build"
|
||||
}
|
||||
else
|
||||
{
|
||||
# 8.0.0-alpha.1234
|
||||
$continuous = "$($version.Release)-alpha.$(Build.BuildNumber)"
|
||||
}
|
||||
$ubuild.SetUmbracoVersion($continuous)
|
||||
$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
|
||||
|
||||
|
||||
#Update the version in templates also
|
||||
$templatePath =
|
||||
'build/templates/UmbracoPackage/.template.config/template.json'
|
||||
|
||||
$templatePath =
|
||||
'build/templates/UmbracoProject/.template.config/template.json'
|
||||
$a = Get-Content $templatePath -raw | ConvertFrom-Json
|
||||
|
||||
$a = Get-Content $templatePath -raw | ConvertFrom-Json
|
||||
$a.symbols.version.defaultValue = $continuous
|
||||
|
||||
$a.symbols.version.defaultValue = $continuous
|
||||
$a | ConvertTo-Json -depth 32| set-content $templatePath
|
||||
Write-Host "##vso[build.addbuildtag]Continuous build"
|
||||
|
||||
$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
|
||||
|
||||
Write-Host "##vso[build.updatebuildnumber]$continuous.$(Build.BuildId)"
|
||||
|
||||
Write-Host "Building: $continuous"
|
||||
- task: PowerShell@1
|
||||
|
||||
Reference in New Issue
Block a user