mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-06 14:19:45 +00:00
I got tired of renaming the packages that came out of our build pipeline. I also got tired of the fact that every appxbundle artifact we upload comes with another whole copy of Terminal for every architecture, plus all their symbols. Those are reflected in other artifacts, so there's no reason to duplicate them.
723 lines
28 KiB
YAML
723 lines
28 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
|
|
- name: buildWindowsVersions
|
|
type: object
|
|
default:
|
|
- Win10
|
|
- Win11
|
|
|
|
variables:
|
|
TerminalInternalPackageVersion: "0.0.7"
|
|
# 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
|
|
# The NuGet packages have to use *somebody's* DLLs. We used to force them to
|
|
# use the Win10 build outputs, but if there isn't a Win10 build we should use
|
|
# the Win11 one.
|
|
${{ if containsValue(parameters.buildWindowsVersions, 'Win10') }}:
|
|
TerminalBestVersionForNuGetPackages: Win10
|
|
${{ else }}:
|
|
TerminalBestVersionForNuGetPackages: Win11
|
|
|
|
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 }}:
|
|
${{ each windowsVersion in parameters.buildWindowsVersions }}:
|
|
${{ config }}_${{ platform }}_${{ windowsVersion }}:
|
|
BuildConfiguration: ${{ config }}
|
|
BuildPlatform: ${{ platform }}
|
|
TerminalTargetWindowsVersion: ${{ windowsVersion }}
|
|
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) }}:
|
|
- pwsh: |-
|
|
./build/scripts/Patch-ManifestsToWindowsVersion.ps1 -NewWindowsVersion "10.0.22000.0"
|
|
displayName: Update manifest target version to Win11 (if necessary)
|
|
condition: and(succeeded(), eq(variables['TerminalTargetWindowsVersion'], 'Win11'))
|
|
- 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)-$(TerminalTargetWindowsVersion)
|
|
- 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 *.appx/*.msix to Artifacts
|
|
inputs:
|
|
Contents: >-
|
|
**/*.appx
|
|
|
|
**/*.msix
|
|
|
|
**/*.appxsym
|
|
|
|
!**/Microsoft.VCLibs*.appx
|
|
TargetFolder: $(Build.ArtifactStagingDirectory)/appx
|
|
OverWrite: true
|
|
flattenFolders: true
|
|
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
|
displayName: 'Generate SBOM manifest'
|
|
inputs:
|
|
BuildDropPath: '$(System.ArtifactsDirectory)/appx'
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: Publish Artifact (appx)
|
|
inputs:
|
|
PathtoPublish: $(Build.ArtifactStagingDirectory)/appx
|
|
ArtifactName: appx-$(BuildPlatform)-$(BuildConfiguration)-$(TerminalTargetWindowsVersion)
|
|
- ${{ 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)-$(TerminalTargetWindowsVersion)
|
|
- ${{ 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)-$(TerminalTargetWindowsVersion)
|
|
|
|
- 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
|
|
strategy:
|
|
matrix:
|
|
${{ each windowsVersion in parameters.buildWindowsVersions }}:
|
|
${{ windowsVersion }}:
|
|
TerminalTargetWindowsVersion: ${{ windowsVersion }}
|
|
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@0
|
|
displayName: Download Artifacts ${{ platform }} $(TerminalTargetWindowsVersion)
|
|
inputs:
|
|
artifactName: appx-${{ platform }}-Release-$(TerminalTargetWindowsVersion)
|
|
# 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 "$(System.ArtifactsDirectory)" -ProjectName CascadiaPackage -BundleVersion $BundleVersion -OutputPath "$(System.ArtifactsDirectory)\bundle\$(BundleStemName)_$(TerminalTargetWindowsVersion)_$(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: PublishBuildArtifacts@1
|
|
displayName: 'Publish Artifact: appxbundle-signed'
|
|
inputs:
|
|
PathtoPublish: $(System.ArtifactsDirectory)\bundle
|
|
ArtifactName: appxbundle-signed-$(TerminalTargetWindowsVersion)
|
|
|
|
- ${{ 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@0
|
|
displayName: Download ${{ platform }} ConPTY binaries
|
|
inputs:
|
|
artifactName: conpty-dll-${{ platform }}-$(BuildConfiguration)-$(TerminalBestVersionForNuGetPackages)
|
|
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@0
|
|
displayName: Download ${{ platform }} PublicTerminalCore
|
|
inputs:
|
|
artifactName: wpf-dll-${{ platform }}-$(BuildConfiguration)-$(TerminalBestVersionForNuGetPackages)
|
|
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 appx-PLATFORM-CONFIG-VERSION artifact for every platform/version combo
|
|
- ${{ each platform in parameters.buildPlatforms }}:
|
|
- ${{ each windowsVersion in parameters.buildWindowsVersions }}:
|
|
- task: DownloadBuildArtifacts@0
|
|
displayName: Download Symbols ${{ platform }} ${{ windowsVersion }}
|
|
inputs:
|
|
artifactName: appx-${{ platform }}-Release-${{ windowsVersion }}
|
|
|
|
# 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@0
|
|
displayName: Download Build Artifacts
|
|
inputs:
|
|
artifactName: appxbundle-signed-Win11
|
|
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_Win11_*.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-Win11
|
|
- task: PkgESVPack@12
|
|
displayName: 'Package ES - VPack'
|
|
env:
|
|
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
|
inputs:
|
|
sourceDirectory: $(System.ArtifactsDirectory)\appxbundle-signed-Win11\WindowsTerminal.app
|
|
description: VPack for the Windows Terminal Application
|
|
pushPkgName: WindowsTerminal.app
|
|
owner: conhost
|
|
- 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
|
|
...
|