2024-03-27 02:27:33 +08:00
|
|
|
parameters:
|
|
|
|
ReleaseTagVar: v6.2.0
|
|
|
|
ReleaseTagVarName: ReleaseTagVar
|
|
|
|
CreateJson: 'no'
|
|
|
|
UseJson: 'yes'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- ${{ if eq(parameters['UseJson'],'yes') }}:
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
inputs:
|
2024-05-21 05:54:00 +08:00
|
|
|
artifactName: 'drop_prep_SetVars'
|
2024-03-27 02:27:33 +08:00
|
|
|
itemPattern: '*.json'
|
|
|
|
downloadPath: '$(System.ArtifactsDirectory)'
|
|
|
|
displayName: Download Build Info Json
|
|
|
|
env:
|
2024-04-23 07:26:03 +08:00
|
|
|
ob_restore_phase: true # This ensures this done in restore phase to workaround signing issue
|
2024-03-27 02:27:33 +08:00
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
$path = "./build.psm1"
|
|
|
|
if($env:REPOROOT){
|
|
|
|
Write-Verbose "reporoot already set to ${env:REPOROOT}" -Verbose
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
if(Test-Path -Path $path)
|
|
|
|
{
|
|
|
|
Write-Verbose "reporoot detect at: ." -Verbose
|
|
|
|
$repoRoot = '.'
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$path = "./PowerShell/build.psm1"
|
|
|
|
if(Test-Path -Path $path)
|
|
|
|
{
|
|
|
|
Write-Verbose "reporoot detect at: ./PowerShell" -Verbose
|
|
|
|
$repoRoot = './PowerShell'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($repoRoot) {
|
|
|
|
$vstsCommandString = "vso[task.setvariable variable=repoRoot]$repoRoot"
|
|
|
|
Write-Host ("sending " + $vstsCommandString)
|
|
|
|
Write-Host "##$vstsCommandString"
|
|
|
|
} else {
|
|
|
|
Write-Verbose -Verbose "repo not found"
|
|
|
|
}
|
|
|
|
displayName: 'Set repo Root'
|
|
|
|
env:
|
2024-04-23 07:26:03 +08:00
|
|
|
ob_restore_phase: true # This ensures this done in restore phase to workaround signing issue
|
2024-03-27 02:27:33 +08:00
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
$createJson = ("${{ parameters.CreateJson }}" -ne "no")
|
2024-05-24 03:13:03 +08:00
|
|
|
|
2024-05-24 03:54:14 +08:00
|
|
|
$REPOROOT = $env:REPOROOT
|
2024-05-24 03:13:03 +08:00
|
|
|
|
2024-05-24 03:54:14 +08:00
|
|
|
if (-not (Test-Path $REPOROOT/tools/releaseBuild/setReleaseTag.ps1)) {
|
|
|
|
if ((Test-Path "$REPOROOT/PowerShell/tools/releaseBuild/setReleaseTag.ps1")) {
|
|
|
|
$REPOROOT = "$REPOROOT/PowerShell"
|
|
|
|
} else {
|
|
|
|
throw "Could not find setReleaseTag.ps1 in $REPOROOT/tools/releaseBuild or $REPOROOT/PowerShell/tools/releaseBuild"
|
2024-05-24 03:13:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-24 03:54:14 +08:00
|
|
|
$releaseTag = & "$REPOROOT/tools/releaseBuild/setReleaseTag.ps1" -ReleaseTag ${{ parameters.ReleaseTagVar }} -Variable "${{ parameters.ReleaseTagVarName }}" -CreateJson:$createJson
|
2024-03-27 02:27:33 +08:00
|
|
|
$version = $releaseTag.Substring(1)
|
|
|
|
$vstsCommandString = "vso[task.setvariable variable=Version]$version"
|
|
|
|
Write-Host ("sending " + $vstsCommandString)
|
|
|
|
Write-Host "##$vstsCommandString"
|
|
|
|
$azureVersion = $releaseTag.ToLowerInvariant() -replace '\.', '-'
|
|
|
|
$vstsCommandString = "vso[task.setvariable variable=AzureVersion]$azureVersion"
|
|
|
|
Write-Host ("sending " + $vstsCommandString)
|
|
|
|
Write-Host "##$vstsCommandString"
|
|
|
|
displayName: 'Set ${{ parameters.ReleaseTagVarName }} and other version Variables'
|
|
|
|
env:
|
2024-04-23 07:26:03 +08:00
|
|
|
ob_restore_phase: true # This ensures this done in restore phase to workaround signing issue
|
2024-03-27 02:27:33 +08:00
|
|
|
|
|
|
|
- powershell: |
|
2024-09-06 05:49:23 +08:00
|
|
|
Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
|
2024-03-27 02:27:33 +08:00
|
|
|
displayName: Capture environment
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
env:
|
2024-04-23 07:26:03 +08:00
|
|
|
ob_restore_phase: true # This ensures this done in restore phase to workaround signing issue
|