initialize.yml•1.55 kB
parameters:
- name: ReleaseRun
type: boolean
default: false
jobs:
- job: Initialize
timeoutInMinutes: 90
steps:
- checkout: self
fetchDepth: 0
- pwsh: |
Write-Host "Attaching build reason string to the build for additional tag generation."
@('$(Build.Reason)') | ConvertTo-Json -AsArray | Out-File -FilePath $(System.DefaultWorkingDirectory)/build-reason.json -Encoding utf8
Write-Host '##vso[task.addattachment type=AdditionalTags;name=AdditionalTags;]$(System.DefaultWorkingDirectory)/build-reason.json'
displayName: Tag build reason
- pwsh: |
./eng/scripts/Get-AreasToTest.ps1 -SetDevOpsVariables -TestType 'Live'
name: GetTestAreasLive
displayName: "Get areas to test (Live)"
workingDirectory: $(Build.SourcesDirectory)
- task: Powershell@2
name: Version
displayName: "Set package version"
condition: and(succeeded(), ne(variables['NoPackagesChanged'],'true'))
inputs:
pwsh: true
filePath: $(Build.SourcesDirectory)/eng/scripts/Get-Version.ps1
${{ if eq(parameters.ReleaseRun, true) }}:
arguments: >
-Variable 'Version'
${{ elseif and(eq(variables['Build.Reason'], 'IndividualCI'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
arguments: >
-Variable 'Version'
-PrereleaseLabel 'beta'
-PrereleaseNumber '$(Build.BuildId)'
${{ else }}:
arguments: >
-Variable 'Version'
-PrereleaseLabel 'alpha'
-PrereleaseNumber '$(Build.BuildId)'