build: use Terrapin for OneBranch as well

This commit is contained in:
Dustin L. Howett
2026-06-17 16:37:38 -05:00
parent 1282d56a33
commit 8c5566edcd
3 changed files with 37 additions and 4 deletions

View File

@@ -121,6 +121,9 @@ extends:
- template: ./build/pipelines/templates-v2/steps-setup-versioning.yml@self
- template: ./build/pipelines/templates-v2/steps-install-terrapin.yml@self
parameters:
useNuget: true
nugetFeed: "https://pkgs.dev.azure.com/microsoft/_packaging/WindowsTerminal/nuget/v3/index.json"
- task: UniversalPackages@0
displayName: Download terminal-internal Universal Package

View File

@@ -142,6 +142,10 @@ extends:
beforeBuildSteps: # Right before we build, lay down the universal package and localizations
- template: ./build/pipelines/templates-v2/steps-setup-versioning.yml@self
- template: ./build/pipelines/templates-v2/steps-install-terrapin.yml@self
parameters:
useNuget: false
- task: UniversalPackages@0
displayName: Download terminal-internal Universal Package
inputs:

View File

@@ -1,6 +1,32 @@
parameters:
- name: useNuget
type: boolean
default: true
- name: nugetFeed
type: string
default: unspecified
steps:
- ${{ if and(eq(parameters.useNuget, true), eq(parameters.nugetFeed, 'unspecified')) }}:
- "useNuget=true but nugetFeed was not specified": error
- pwsh: |-
nuget install -source "https://pkgs.dev.azure.com/microsoft/_packaging/WindowsTerminal/nuget/v3/index.json" TerrapinRetrievalTool -Prerelease -OutputDirectory _trt
$TerrapinRetrievalToolPath = (Get-Item _trt\TerrapinRetrievalTool.*\win-x64\TerrapinRetrievalTool.exe).FullName
Write-Host "##vso[task.setvariable variable=X_VCPKG_ASSET_SOURCES]x-script,${TerrapinRetrievalToolPath} -b https://vcpkg.storage.devpackages.microsoft.io/artifacts/ -a true -u None -p {url} -s {sha512} -d {dst};x-block-origin"
displayName: Set up the Terrapin Retrieval Tool (vcpkg cache)
Write-Host "##vso[task.setvariable variable=X_VCPKG_ASSET_SOURCES]INVALID"
$TerrapinRetrievalTool = Get-ChildItem C:\nugettools\terrapinretrievaltool -Filter TerrapinRetrievalTool.exe -ErrorAction:Ignore -Recurse
If ($null -Ne $TerrapinRetrievalTool) {
$TerrapinRetrievalToolPath = $TerrapinRetrievalTool.FullName
Write-Host "##vso[task.setvariable variable=X_VCPKG_ASSET_SOURCES]x-script,${TerrapinRetrievalToolPath} -b https://vcpkg.storage.devpackages.microsoft.io/artifacts/ -a true -u None -p {url} -s {sha512} -d {dst};x-block-origin"
}
displayName: Detect installed Terrapin Retrieval Tool
- ${{ if eq(parameters.useNuget, true) }}:
- pwsh: |-
nuget install -source "${{ parameters.nugetFeed }}" TerrapinRetrievalTool -Prerelease -OutputDirectory _trt
$TerrapinRetrievalToolPath = (Get-Item _trt\TerrapinRetrievalTool.*\win-x64\TerrapinRetrievalTool.exe).FullName
Write-Host "##vso[task.setvariable variable=X_VCPKG_ASSET_SOURCES]x-script,${TerrapinRetrievalToolPath} -b https://vcpkg.storage.devpackages.microsoft.io/artifacts/ -a true -u None -p {url} -s {sha512} -d {dst};x-block-origin"
displayName: Install the Terrapin Retrieval Tool (vcpkg cache)
condition: and(succeeded(), eq(variables['X_VCPKG_ASSET_SOURCES'], 'INVALID'))
- script: |-
EXIT 1
displayName: Fail the build if Terrapin was not found
condition: and(succeeded(), eq(variables['X_VCPKG_ASSET_SOURCES'], 'INVALID'))