mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-06 14:19:45 +00:00
I originally intended to add the Drop Validator (which is a compliance requirement) task to the build, but I quickly realized that we weren't generating a complete SBOM manifest covering every artifact that we produced. We were generating the SBOM manifest, and then re-packing the Terminal app which very likely invalidated all of the hashes and signatures in the SBOM manifest! We were also missing the unpackaged build. I've removed the `appx-PLATFORM-CONFIG` and `unpackaged-PLAT-CONF` artifacts and combined them into a single one, `terminal-PLAT-CONF`.
752 lines
29 KiB
YAML
752 lines
29 KiB
YAML
# This build should never run as CI or against a pull request.
|
|
trigger: none
|
|
pr: none
|
|
|
|
pool:
|
|
name: WinDevPool-L
|
|
demands: ImageOverride -equals WinDevVS17-latest
|
|
|
|
parameters:
|
|
- name: branding
|
|
displayName: "Branding (Build Type)"
|
|
type: string
|
|
default: Release
|
|
values:
|
|
- Release
|
|
- Preview
|
|
- name: buildTerminal
|
|
displayName: "Build Windows Terminal MSIX"
|
|
type: boolean
|
|
default: true
|
|
- name: runCompliance
|
|
displayName: "Run Compliance and Security Build"
|
|
type: boolean
|
|
default: true
|
|
- name: publishSymbolsToPublic
|
|
displayName: "Publish Symbols to MSDL"
|
|
type: boolean
|
|
default: true
|
|
- name: buildTerminalVPack
|
|
displayName: "Build Windows Terminal VPack"
|
|
type: boolean
|
|
default: false
|
|
- name: buildConPTY
|
|
displayName: "Build ConPTY NuGet"
|
|
type: boolean
|
|
default: false
|
|
- name: buildWPF
|
|
displayName: "Build Terminal WPF Control"
|
|
type: boolean
|
|
default: false
|
|
- name: pgoBuildMode
|
|
displayName: "PGO Build Mode"
|
|
type: string
|
|
default: Optimize
|
|
values:
|
|
- Optimize
|
|
- Instrument
|
|
- None
|
|
- name: buildConfigurations
|
|
type: object
|
|
default:
|
|
- Release
|
|
- name: buildPlatforms
|
|
type: object
|
|
default:
|
|
- x64
|
|
- x86
|
|
- arm64
|
|
|
|
variables:
|
|
MakeAppxPath: 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\MakeAppx.exe'
|
|
TerminalInternalPackageVersion: "0.0.8"
|
|
# If we are building a branch called "release-*", change the NuGet suffix
|
|
# to "preview". If we don't do that, XES will set the suffix to "release1"
|
|
# because it truncates the value after the first period.
|
|
# We also want to disable the suffix entirely if we're Release branded while
|
|
# on a release branch.
|
|
# main is special, however. XES ignores main. Since we never produce actual
|
|
# shipping builds from main, we want to force it to have a beta label as
|
|
# well.
|
|
#
|
|
# In effect:
|
|
# BRANCH / BRANDING | Release | Preview
|
|
# ------------------|----------------------------|-----------------------------
|
|
# release-* | 1.12.20220427 | 1.13.20220427-preview
|
|
# main | 1.14.20220427-experimental | 1.14.20220427-experimental
|
|
# all others | 1.14.20220427-mybranch | 1.14.20220427-mybranch
|
|
${{ if startsWith(variables['Build.SourceBranchName'], 'release-') }}:
|
|
${{ if eq(parameters.branding, 'Release') }}:
|
|
NoNuGetPackBetaVersion: true
|
|
${{ else }}:
|
|
NuGetPackBetaVersion: preview
|
|
${{ elseif eq(variables['Build.SourceBranchName'], 'main') }}:
|
|
NuGetPackBetaVersion: experimental
|
|
|
|
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
|
|
resources:
|
|
repositories:
|
|
- repository: self
|
|
type: git
|
|
ref: main
|
|
jobs:
|
|
- job: Build
|
|
strategy:
|
|
matrix:
|
|
${{ each config in parameters.buildConfigurations }}:
|
|
${{ each platform in parameters.buildPlatforms }}:
|
|
${{ config }}_${{ platform }}:
|
|
BuildConfiguration: ${{ config }}
|
|
BuildPlatform: ${{ platform }}
|
|
displayName: Build
|
|
timeoutInMinutes: 240
|
|
cancelTimeoutInMinutes: 1
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
submodules: true
|
|
persistCredentials: True
|
|
- task: PkgESSetupBuild@12
|
|
displayName: Package ES - Setup Build
|
|
inputs:
|
|
disableOutputRedirect: true
|
|
- task: PowerShell@2
|
|
displayName: Rationalize Build Platform
|
|
inputs:
|
|
targetType: inline
|
|
script: >-
|
|
$Arch = "$(BuildPlatform)"
|
|
|
|
If ($Arch -Eq "x86") { $Arch = "Win32" }
|
|
|
|
Write-Host "##vso[task.setvariable variable=RationalizedBuildPlatform]${Arch}"
|
|
- template: .\templates\restore-nuget-steps.yml
|
|
- task: UniversalPackages@0
|
|
displayName: Download terminal-internal Universal Package
|
|
inputs:
|
|
feedListDownload: 2b3f8893-a6e8-411f-b197-a9e05576da48
|
|
packageListDownload: e82d490c-af86-4733-9dc4-07b772033204
|
|
versionListDownload: $(TerminalInternalPackageVersion)
|
|
- task: TouchdownBuildTask@1
|
|
displayName: Download Localization Files
|
|
inputs:
|
|
teamId: 7105
|
|
authId: $(TouchdownAppId)
|
|
authKey: $(TouchdownAppKey)
|
|
resourceFilePath: >-
|
|
src\cascadia\TerminalApp\Resources\en-US\Resources.resw
|
|
|
|
src\cascadia\TerminalApp\Resources\en-US\ContextMenu.resw
|
|
|
|
src\cascadia\TerminalControl\Resources\en-US\Resources.resw
|
|
|
|
src\cascadia\TerminalConnection\Resources\en-US\Resources.resw
|
|
|
|
src\cascadia\TerminalSettingsModel\Resources\en-US\Resources.resw
|
|
|
|
src\cascadia\TerminalSettingsEditor\Resources\en-US\Resources.resw
|
|
|
|
src\cascadia\CascadiaPackage\Resources\en-US\Resources.resw
|
|
appendRelativeDir: true
|
|
localizationTarget: false
|
|
pseudoSetting: Included
|
|
- task: PowerShell@2
|
|
displayName: Move Loc files one level up
|
|
inputs:
|
|
targetType: inline
|
|
script: >-
|
|
$Files = Get-ChildItem . -R -Filter 'Resources.resw' | ? FullName -Like '*en-US\*\Resources.resw'
|
|
|
|
$Files | % { Move-Item -Verbose $_.Directory $_.Directory.Parent.Parent -EA:Ignore }
|
|
pwsh: true
|
|
- task: PowerShell@2
|
|
displayName: Copy the Context Menu Loc Resources to CascadiaPackage
|
|
inputs:
|
|
filePath: ./build/scripts/Copy-ContextMenuResourcesToCascadiaPackage.ps1
|
|
pwsh: true
|
|
- task: PowerShell@2
|
|
displayName: Generate NOTICE.html from NOTICE.md
|
|
inputs:
|
|
filePath: .\build\scripts\Generate-ThirdPartyNotices.ps1
|
|
arguments: -MarkdownNoticePath .\NOTICE.md -OutputPath .\src\cascadia\CascadiaPackage\NOTICE.html
|
|
pwsh: true
|
|
- ${{ if eq(parameters.buildTerminal, true) }}:
|
|
- task: VSBuild@1
|
|
displayName: Build solution **\OpenConsole.sln
|
|
condition: true
|
|
inputs:
|
|
solution: '**\OpenConsole.sln'
|
|
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /t:Terminal\CascadiaPackage /p:WindowsTerminalReleaseBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
|
platform: $(BuildPlatform)
|
|
configuration: $(BuildConfiguration)
|
|
clean: true
|
|
maximumCpuCount: true
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: 'Publish Artifact: binlog'
|
|
condition: failed()
|
|
continueOnError: True
|
|
inputs:
|
|
PathtoPublish: $(Build.SourcesDirectory)\msbuild.binlog
|
|
ArtifactName: binlog-$(BuildPlatform)
|
|
- task: PowerShell@2
|
|
displayName: Check MSIX for common regressions
|
|
inputs:
|
|
targetType: inline
|
|
script: >-
|
|
$Package = Get-ChildItem -Recurse -Filter "CascadiaPackage_*.msix"
|
|
|
|
.\build\scripts\Test-WindowsTerminalPackage.ps1 -Verbose -Path $Package.FullName
|
|
pwsh: true
|
|
- ${{ if eq(parameters.buildWPF, true) }}:
|
|
- task: VSBuild@1
|
|
displayName: Build solution **\OpenConsole.sln for PublicTerminalCore
|
|
inputs:
|
|
solution: '**\OpenConsole.sln'
|
|
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /p:WindowsTerminalReleaseBuild=true /t:Terminal\wpf\PublicTerminalCore
|
|
platform: $(BuildPlatform)
|
|
configuration: $(BuildConfiguration)
|
|
- ${{ if eq(parameters.buildConPTY, true) }}:
|
|
- task: VSBuild@1
|
|
displayName: Build solution **\OpenConsole.sln for ConPTY
|
|
inputs:
|
|
solution: '**\OpenConsole.sln'
|
|
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /p:WindowsTerminalReleaseBuild=true /t:Conhost\Host_EXE;Conhost\winconpty_DLL
|
|
platform: $(BuildPlatform)
|
|
configuration: $(BuildConfiguration)
|
|
- task: PowerShell@2
|
|
displayName: Source Index PDBs
|
|
inputs:
|
|
filePath: build\scripts\Index-Pdbs.ps1
|
|
arguments: -SearchDir '$(Build.SourcesDirectory)' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion)
|
|
errorActionPreference: silentlyContinue
|
|
pwsh: true
|
|
- task: PowerShell@2
|
|
displayName: Run Unit Tests
|
|
condition: and(succeeded(), or(eq(variables['BuildPlatform'], 'x64'), eq(variables['BuildPlatform'], 'x86')))
|
|
enabled: False
|
|
inputs:
|
|
filePath: build\scripts\Run-Tests.ps1
|
|
arguments: -MatchPattern '*unit.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)'
|
|
- task: PowerShell@2
|
|
displayName: Run Feature Tests
|
|
condition: and(succeeded(), eq(variables['BuildPlatform'], 'x64'))
|
|
enabled: False
|
|
inputs:
|
|
filePath: build\scripts\Run-Tests.ps1
|
|
arguments: -MatchPattern '*feature.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)'
|
|
- ${{ if eq(parameters.buildTerminal, true) }}:
|
|
- task: CopyFiles@2
|
|
displayName: Copy *.msix and symbols to Artifacts
|
|
inputs:
|
|
Contents: >-
|
|
**/*.msix
|
|
|
|
**/*.appxsym
|
|
TargetFolder: $(Build.ArtifactStagingDirectory)/appx
|
|
OverWrite: true
|
|
flattenFolders: true
|
|
|
|
- pwsh: |-
|
|
$Package = (Get-ChildItem "$(Build.ArtifactStagingDirectory)/appx" -Recurse -Filter "Cascadia*.msix" | Select -First 1)
|
|
$PackageFilename = $Package.FullName
|
|
Write-Host "##vso[task.setvariable variable=WindowsTerminalPackagePath]${PackageFilename}"
|
|
& "$(MakeAppxPath)" unpack /p $PackageFilename /d "$(Build.SourcesDirectory)\UnpackedTerminalPackage"
|
|
displayName: Unpack the new Terminal package for signing
|
|
|
|
- task: EsrpCodeSigning@1
|
|
displayName: Submit Terminal's binaries for signing
|
|
inputs:
|
|
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
|
FolderPath: '$(Build.SourcesDirectory)\UnpackedTerminalPackage'
|
|
signType: batchSigning
|
|
batchSignPolicyFile: '$(Build.SourcesDirectory)\build\config\ESRPSigning_Terminal.json'
|
|
|
|
- pwsh: |-
|
|
$PackageFilename = "$(WindowsTerminalPackagePath)"
|
|
Remove-Item "$(Build.SourcesDirectory)\UnpackedTerminalPackage\CodeSignSummary*"
|
|
& "$(MakeAppxPath)" pack /h SHA256 /o /p $PackageFilename /d "$(Build.SourcesDirectory)\UnpackedTerminalPackage"
|
|
displayName: Re-pack the new Terminal package after signing
|
|
|
|
- pwsh: |-
|
|
$XamlAppxPath = (Get-Item "src\cascadia\CascadiaPackage\AppPackages\*\Dependencies\$(BuildPlatform)\Microsoft.UI.Xaml*.appx").FullName
|
|
& .\build\scripts\New-UnpackagedTerminalDistribution.ps1 -TerminalAppX $(WindowsTerminalPackagePath) -XamlAppX $XamlAppxPath -Destination "$(Build.ArtifactStagingDirectory)/appx"
|
|
displayName: Build Unpackaged Distribution
|
|
|
|
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
|
displayName: 'Generate SBOM manifest (application)'
|
|
inputs:
|
|
BuildDropPath: '$(System.ArtifactsDirectory)/appx'
|
|
|
|
- task: DropValidatorTask@0
|
|
displayName: 'Validate application SBOM manifest'
|
|
inputs:
|
|
BuildDropPath: '$(System.ArtifactsDirectory)/appx'
|
|
OutputPath: 'output.json'
|
|
ValidateSignature: true
|
|
Verbosity: 'Verbose'
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: Publish Artifact (Terminal app)
|
|
inputs:
|
|
PathtoPublish: $(Build.ArtifactStagingDirectory)/appx
|
|
ArtifactName: terminal-$(BuildPlatform)-$(BuildConfiguration)
|
|
|
|
- ${{ if eq(parameters.buildConPTY, true) }}:
|
|
- task: CopyFiles@2
|
|
displayName: Copy ConPTY to Artifacts
|
|
inputs:
|
|
Contents: |-
|
|
$(Build.SourcesDirectory)/bin/**/conpty.dll
|
|
$(Build.SourcesDirectory)/bin/**/conpty.lib
|
|
$(Build.SourcesDirectory)/bin/**/conpty.pdb
|
|
$(Build.SourcesDirectory)/bin/**/OpenConsole.exe
|
|
$(Build.SourcesDirectory)/bin/**/OpenConsole.pdb
|
|
TargetFolder: $(Build.ArtifactStagingDirectory)/conpty
|
|
OverWrite: true
|
|
flattenFolders: true
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: Publish Artifact (ConPTY)
|
|
inputs:
|
|
PathtoPublish: $(Build.ArtifactStagingDirectory)/conpty
|
|
ArtifactName: conpty-dll-$(BuildPlatform)-$(BuildConfiguration)
|
|
- ${{ if eq(parameters.buildWPF, true) }}:
|
|
- task: CopyFiles@2
|
|
displayName: Copy PublicTerminalCore.dll to Artifacts
|
|
inputs:
|
|
Contents: >-
|
|
**/PublicTerminalCore.dll
|
|
TargetFolder: $(Build.ArtifactStagingDirectory)/wpf
|
|
OverWrite: true
|
|
flattenFolders: true
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: Publish Artifact (PublicTerminalCore)
|
|
inputs:
|
|
PathtoPublish: $(Build.ArtifactStagingDirectory)/wpf
|
|
ArtifactName: wpf-dll-$(BuildPlatform)-$(BuildConfiguration)
|
|
|
|
- task: PublishSymbols@2
|
|
displayName: Publish symbols path
|
|
continueOnError: True
|
|
inputs:
|
|
SearchPattern: |
|
|
$(Build.SourcesDirectory)/bin/**/*.pdb
|
|
$(Build.SourcesDirectory)/bin/**/*.exe
|
|
$(Build.SourcesDirectory)/bin/**/*.dll
|
|
IndexSources: false
|
|
SymbolServerType: TeamServices
|
|
|
|
- ${{ if eq(parameters.runCompliance, true) }}:
|
|
- template: ./templates/build-console-compliance-job.yml
|
|
|
|
- ${{ if eq(parameters.buildTerminal, true) }}:
|
|
- job: BundleAndSign
|
|
displayName: Create and sign AppX/MSIX bundles
|
|
variables:
|
|
${{ if eq(parameters.branding, 'Release') }}:
|
|
BundleStemName: Microsoft.WindowsTerminal
|
|
${{ elseif eq(parameters.branding, 'Preview') }}:
|
|
BundleStemName: Microsoft.WindowsTerminalPreview
|
|
${{ else }}:
|
|
BundleStemName: WindowsTerminalDev
|
|
dependsOn: Build
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
fetchDepth: 1
|
|
submodules: true
|
|
persistCredentials: True
|
|
- task: PkgESSetupBuild@12
|
|
displayName: Package ES - Setup Build
|
|
inputs:
|
|
disableOutputRedirect: true
|
|
- ${{ each platform in parameters.buildPlatforms }}:
|
|
- task: DownloadBuildArtifacts@1
|
|
displayName: Download Artifacts ${{ platform }}
|
|
inputs:
|
|
# Make sure to download the entire artifact, because it includes the SPDX SBOM
|
|
artifactName: terminal-${{ platform }}-Release
|
|
# Downloading to the source directory should ensure that the later SBOM generator can see the earlier SBOMs.
|
|
downloadPath: '$(Build.SourcesDirectory)/appx-artifacts'
|
|
# Add 3000 to the major version component, but only for the bundle.
|
|
# This is to ensure that it is newer than "2022.xx.yy.zz" or whatever the original bundle versions were before
|
|
# we switched to uniform naming.
|
|
- pwsh: |-
|
|
$VersionEpoch = 3000
|
|
$Components = "$(XES_APPXMANIFESTVERSION)" -Split "\."
|
|
$Components[0] = ([int]$Components[0] + $VersionEpoch)
|
|
$BundleVersion = $Components -Join "."
|
|
New-Item -Type Directory "$(System.ArtifactsDirectory)\bundle"
|
|
.\build\scripts\Create-AppxBundle.ps1 -InputPath "$(Build.SourcesDirectory)/appx-artifacts" -ProjectName CascadiaPackage -BundleVersion $BundleVersion -OutputPath "$(System.ArtifactsDirectory)\bundle\$(BundleStemName)_$(XES_APPXMANIFESTVERSION)_8wekyb3d8bbwe.msixbundle"
|
|
displayName: Create WindowsTerminal*.msixbundle
|
|
- task: EsrpCodeSigning@1
|
|
displayName: Submit *.msixbundle to ESRP for code signing
|
|
inputs:
|
|
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
|
FolderPath: $(System.ArtifactsDirectory)\bundle
|
|
Pattern: $(BundleStemName)*.msixbundle
|
|
UseMinimatch: true
|
|
signConfigType: inlineSignParams
|
|
inlineOperation: >-
|
|
[
|
|
{
|
|
"KeyCode": "Dynamic",
|
|
"CertTemplateName": "WINMSAPP1ST",
|
|
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
|
|
"OperationCode": "SigntoolSign",
|
|
"Parameters": {
|
|
"OpusName": "Microsoft",
|
|
"OpusInfo": "http://www.microsoft.com",
|
|
"FileDigest": "/fd \"SHA256\"",
|
|
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
|
},
|
|
"ToolName": "sign",
|
|
"ToolVersion": "1.0"
|
|
},
|
|
{
|
|
"KeyCode": "Dynamic",
|
|
"CertTemplateName": "WINMSAPP1ST",
|
|
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
|
|
"OperationCode": "SigntoolVerify",
|
|
"Parameters": {},
|
|
"ToolName": "sign",
|
|
"ToolVersion": "1.0"
|
|
}
|
|
]
|
|
|
|
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
|
displayName: 'Generate SBOM manifest (bundle)'
|
|
inputs:
|
|
BuildDropPath: '$(System.ArtifactsDirectory)/bundle'
|
|
BuildComponentPath: '$(Build.SourcesDirectory)/appx-artifacts'
|
|
|
|
- task: DropValidatorTask@0
|
|
displayName: 'Validate bundle SBOM manifest'
|
|
inputs:
|
|
BuildDropPath: '$(System.ArtifactsDirectory)/bundle'
|
|
OutputPath: 'output.json'
|
|
ValidateSignature: true
|
|
Verbosity: 'Verbose'
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: 'Publish Artifact: appxbundle-signed'
|
|
inputs:
|
|
PathtoPublish: $(System.ArtifactsDirectory)\bundle
|
|
ArtifactName: appxbundle-signed
|
|
|
|
- ${{ if eq(parameters.buildConPTY, true) }}:
|
|
- job: PackageAndSignConPTY
|
|
strategy:
|
|
matrix:
|
|
${{ each config in parameters.buildConfigurations }}:
|
|
${{ config }}:
|
|
BuildConfiguration: ${{ config }}
|
|
displayName: Create NuGet Package (ConPTY)
|
|
dependsOn: Build
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
fetchDepth: 1
|
|
submodules: true
|
|
persistCredentials: True
|
|
- task: PkgESSetupBuild@12
|
|
displayName: Package ES - Setup Build
|
|
inputs:
|
|
disableOutputRedirect: true
|
|
- ${{ each platform in parameters.buildPlatforms }}:
|
|
- task: DownloadBuildArtifacts@1
|
|
displayName: Download ${{ platform }} ConPTY binaries
|
|
inputs:
|
|
artifactName: conpty-dll-${{ platform }}-$(BuildConfiguration)
|
|
downloadPath: bin\${{ platform }}\$(BuildConfiguration)\
|
|
extractTars: false
|
|
- task: PowerShell@2
|
|
displayName: Move downloaded artifacts around
|
|
inputs:
|
|
targetType: inline
|
|
# Find all artifact files and move them up a directory. Ugh.
|
|
script: |-
|
|
Get-ChildItem bin -Recurse -Directory -Filter conpty-dll-* | % {
|
|
$_ | Get-ChildItem -Recurse -File | % {
|
|
Move-Item -Verbose $_.FullName $_.Directory.Parent.FullName
|
|
}
|
|
}
|
|
Move-Item bin\x86 bin\Win32
|
|
|
|
- task: EsrpCodeSigning@1
|
|
displayName: Submit ConPTY libraries and OpenConsole for code signing
|
|
inputs:
|
|
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
|
FolderPath: '$(Build.SourcesDirectory)/bin'
|
|
signType: batchSigning
|
|
batchSignPolicyFile: '$(Build.SourcesDirectory)\build\config\ESRPSigning_ConPTY.json'
|
|
|
|
- task: NuGetToolInstaller@1
|
|
displayName: Use NuGet 5.10.0
|
|
inputs:
|
|
versionSpec: 5.10.0
|
|
- task: NuGetCommand@2
|
|
displayName: NuGet pack
|
|
inputs:
|
|
command: pack
|
|
packagesToPack: $(Build.SourcesDirectory)\src\winconpty\package\winconpty.nuspec
|
|
packDestination: '$(Build.ArtifactStagingDirectory)/nupkg'
|
|
versioningScheme: byEnvVar
|
|
versionEnvVar: XES_PACKAGEVERSIONNUMBER
|
|
- task: EsrpCodeSigning@1
|
|
displayName: Submit *.nupkg to ESRP for code signing
|
|
inputs:
|
|
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
|
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
|
|
Pattern: '*.nupkg'
|
|
UseMinimatch: true
|
|
signConfigType: inlineSignParams
|
|
inlineOperation: >-
|
|
[
|
|
{
|
|
"KeyCode": "CP-401405",
|
|
"OperationCode": "NuGetSign",
|
|
"Parameters": {},
|
|
"ToolName": "sign",
|
|
"ToolVersion": "1.0"
|
|
},
|
|
{
|
|
"KeyCode": "CP-401405",
|
|
"OperationCode": "NuGetVerify",
|
|
"Parameters": {},
|
|
"ToolName": "sign",
|
|
"ToolVersion": "1.0"
|
|
}
|
|
]
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: Publish Artifact (nupkg)
|
|
inputs:
|
|
PathtoPublish: $(Build.ArtifactStagingDirectory)\nupkg
|
|
ArtifactName: conpty-nupkg-$(BuildConfiguration)
|
|
|
|
|
|
- ${{ if eq(parameters.buildWPF, true) }}:
|
|
- job: PackageAndSignWPF
|
|
strategy:
|
|
matrix:
|
|
${{ each config in parameters.buildConfigurations }}:
|
|
${{ config }}:
|
|
BuildConfiguration: ${{ config }}
|
|
displayName: Create NuGet Package (WPF Terminal Control)
|
|
dependsOn: Build
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
fetchDepth: 1
|
|
submodules: true
|
|
persistCredentials: True
|
|
- task: PkgESSetupBuild@12
|
|
displayName: Package ES - Setup Build
|
|
inputs:
|
|
disableOutputRedirect: true
|
|
- ${{ each platform in parameters.buildPlatforms }}:
|
|
- task: DownloadBuildArtifacts@1
|
|
displayName: Download ${{ platform }} PublicTerminalCore
|
|
inputs:
|
|
artifactName: wpf-dll-${{ platform }}-$(BuildConfiguration)
|
|
itemPattern: '**/*.dll'
|
|
downloadPath: bin\${{ platform }}\$(BuildConfiguration)\
|
|
extractTars: false
|
|
- task: PowerShell@2
|
|
displayName: Move downloaded artifacts around
|
|
inputs:
|
|
targetType: inline
|
|
# Find all artifact files and move them up a directory. Ugh.
|
|
script: |-
|
|
Get-ChildItem bin -Recurse -Directory -Filter wpf-dll-* | % {
|
|
$_ | Get-ChildItem -Recurse -File | % {
|
|
Move-Item -Verbose $_.FullName $_.Directory.Parent.FullName
|
|
}
|
|
}
|
|
Move-Item bin\x86 bin\Win32
|
|
- task: NuGetToolInstaller@1
|
|
displayName: Use NuGet 5.10.0
|
|
inputs:
|
|
versionSpec: 5.10.0
|
|
- task: NuGetCommand@2
|
|
displayName: NuGet restore copy
|
|
inputs:
|
|
selectOrConfig: config
|
|
nugetConfigPath: NuGet.Config
|
|
- task: VSBuild@1
|
|
displayName: Build solution **\OpenConsole.sln for WPF Control
|
|
inputs:
|
|
solution: '**\OpenConsole.sln'
|
|
msbuildArgs: /p:WindowsTerminalReleaseBuild=$(UseReleaseBranding);Version=$(XES_PACKAGEVERSIONNUMBER) /t:Pack
|
|
platform: Any CPU
|
|
configuration: $(BuildConfiguration)
|
|
maximumCpuCount: true
|
|
- task: PublishSymbols@2
|
|
displayName: Publish symbols path
|
|
continueOnError: True
|
|
inputs:
|
|
SearchPattern: |
|
|
$(Build.SourcesDirectory)/bin/**/*.pdb
|
|
$(Build.SourcesDirectory)/bin/**/*.exe
|
|
$(Build.SourcesDirectory)/bin/**/*.dll
|
|
IndexSources: false
|
|
SymbolServerType: TeamServices
|
|
SymbolsArtifactName: Symbols_WPF_$(BuildConfiguration)
|
|
- task: CopyFiles@2
|
|
displayName: Copy *.nupkg to Artifacts
|
|
inputs:
|
|
Contents: '**/*Wpf*.nupkg'
|
|
TargetFolder: $(Build.ArtifactStagingDirectory)/nupkg
|
|
OverWrite: true
|
|
flattenFolders: true
|
|
- task: EsrpCodeSigning@1
|
|
displayName: Submit *.nupkg to ESRP for code signing
|
|
inputs:
|
|
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
|
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
|
|
Pattern: '*.nupkg'
|
|
UseMinimatch: true
|
|
signConfigType: inlineSignParams
|
|
inlineOperation: >-
|
|
[
|
|
{
|
|
"KeyCode": "CP-401405",
|
|
"OperationCode": "NuGetSign",
|
|
"Parameters": {},
|
|
"ToolName": "sign",
|
|
"ToolVersion": "1.0"
|
|
},
|
|
{
|
|
"KeyCode": "CP-401405",
|
|
"OperationCode": "NuGetVerify",
|
|
"Parameters": {},
|
|
"ToolName": "sign",
|
|
"ToolVersion": "1.0"
|
|
}
|
|
]
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: Publish Artifact (nupkg)
|
|
inputs:
|
|
PathtoPublish: $(Build.ArtifactStagingDirectory)\nupkg
|
|
ArtifactName: wpf-nupkg-$(BuildConfiguration)
|
|
|
|
- ${{ if eq(parameters.publishSymbolsToPublic, true) }}:
|
|
- job: PublishSymbols
|
|
displayName: Publish Symbols
|
|
dependsOn: BundleAndSign
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
fetchDepth: 1
|
|
submodules: true
|
|
- task: PkgESSetupBuild@12
|
|
displayName: Package ES - Setup Build
|
|
|
|
- template: .\templates\restore-nuget-steps.yml
|
|
|
|
# Download the terminal-PLATFORM-CONFIG-VERSION artifact for every platform/version combo
|
|
- ${{ each platform in parameters.buildPlatforms }}:
|
|
- task: DownloadBuildArtifacts@1
|
|
displayName: Download Symbols ${{ platform }}
|
|
inputs:
|
|
artifactName: terminal-${{ platform }}-Release
|
|
itemPattern: '**/*.appxsym'
|
|
|
|
# It seems easier to do this -- download every appxsym -- then enumerate all the PDBs in the build directory for the
|
|
# public symbol push. Otherwise, we would have to list all of the PDB files one by one.
|
|
- pwsh: |-
|
|
mkdir $(Build.SourcesDirectory)/appxsym-temp
|
|
Get-ChildItem "$(System.ArtifactsDirectory)" -Filter *.appxsym -Recurse | % {
|
|
$src = $_.FullName
|
|
$dest = Join-Path "$(Build.SourcesDirectory)/appxsym-temp/" $_.Name
|
|
|
|
mkdir $dest
|
|
Write-Host "Extracting $src to $dest..."
|
|
tar -x -v -f $src -C $dest
|
|
}
|
|
displayName: Extract symbols for public consumption
|
|
|
|
- task: PowerShell@2
|
|
displayName: Source Index PDBs (the public ones)
|
|
inputs:
|
|
filePath: build\scripts\Index-Pdbs.ps1
|
|
arguments: -SearchDir '$(Build.SourcesDirectory)/appxsym-temp' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion)
|
|
pwsh: true
|
|
|
|
# Publish the app symbols to the public MSDL symbol server
|
|
# accessible via https://msdl.microsoft.com/download/symbols
|
|
- task: PublishSymbols@2
|
|
displayName: 'Publish app symbols to MSDL'
|
|
inputs:
|
|
symbolsFolder: '$(Build.SourcesDirectory)/appxsym-temp'
|
|
searchPattern: '**/*.pdb'
|
|
SymbolsMaximumWaitTime: 30
|
|
SymbolServerType: 'TeamServices'
|
|
SymbolsProduct: 'Windows Terminal Application Binaries'
|
|
SymbolsVersion: '$(XES_APPXMANIFESTVERSION)'
|
|
# The ADO task does not support indexing of GitHub sources.
|
|
indexSources: false
|
|
detailedLog: true
|
|
# There is a bug which causes this task to fail if LIB includes an inaccessible path (even though it does not depend on it).
|
|
# To work around this issue, we just force LIB to be any dir that we know exists.
|
|
# Copied from https://github.com/microsoft/icu/blob/f869c214adc87415dfe751d81f42f1bca55dcf5f/build/azure-nuget.yml#L564-L583
|
|
env:
|
|
LIB: $(Build.SourcesDirectory)
|
|
ArtifactServices_Symbol_AccountName: microsoftpublicsymbols
|
|
ArtifactServices_Symbol_PAT: $(ADO_microsoftpublicsymbols_PAT)
|
|
|
|
|
|
- ${{ if eq(parameters.buildTerminalVPack, true) }}:
|
|
- job: VPack
|
|
displayName: Create Windows vPack
|
|
dependsOn: BundleAndSign
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
fetchDepth: 1
|
|
submodules: true
|
|
- task: PkgESSetupBuild@12
|
|
displayName: Package ES - Setup Build
|
|
- task: DownloadBuildArtifacts@1
|
|
displayName: Download Build Artifacts
|
|
inputs:
|
|
artifactName: appxbundle-signed
|
|
extractTars: false
|
|
- task: PowerShell@2
|
|
displayName: Rename and stage packages for vpack
|
|
inputs:
|
|
targetType: inline
|
|
script: >-
|
|
# Rename to known/fixed name for Windows build system
|
|
|
|
Get-ChildItem Microsoft.WindowsTerminal_*.msixbundle | Rename-Item -NewName { 'Microsoft.WindowsTerminal_8wekyb3d8bbwe.msixbundle' }
|
|
|
|
|
|
# Create vpack directory and place item inside
|
|
|
|
mkdir WindowsTerminal.app
|
|
|
|
mv Microsoft.WindowsTerminal_8wekyb3d8bbwe.msixbundle .\WindowsTerminal.app\
|
|
workingDirectory: $(System.ArtifactsDirectory)\appxbundle-signed
|
|
- task: PkgESVPack@12
|
|
displayName: 'Package ES - VPack'
|
|
env:
|
|
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
|
inputs:
|
|
sourceDirectory: $(System.ArtifactsDirectory)\appxbundle-signed\WindowsTerminal.app
|
|
description: VPack for the Windows Terminal Application
|
|
pushPkgName: WindowsTerminal.app
|
|
owner: conhost
|
|
githubToken: $(GitHubTokenForVpackProvenance)
|
|
- task: PublishPipelineArtifact@1
|
|
displayName: 'Copy VPack Manifest to Drop'
|
|
inputs:
|
|
targetPath: $(XES_VPACKMANIFESTDIRECTORY)
|
|
artifactName: VPackManifest
|
|
- task: PkgESFCIBGit@12
|
|
displayName: 'Submit VPack Manifest to Windows'
|
|
inputs:
|
|
configPath: '$(Build.SourcesDirectory)\build\config\GitCheckin.json'
|
|
artifactsDirectory: $(XES_VPACKMANIFESTDIRECTORY)
|
|
prTimeOut: 5
|
|
...
|