-
Notifications
You must be signed in to change notification settings - Fork 8.2k
/
job-build-package-wpf.yml
144 lines (134 loc) · 4.5 KB
/
job-build-package-wpf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
parameters:
- name: buildConfigurations
type: object
- name: buildPlatforms
type: object
- name: generateSbom
type: boolean
default: false
- name: codeSign
type: boolean
default: false
- name: pool
type: object
default: []
- name: dependsOn
type: object
default: null
- name: artifactStem
type: string
default: ''
- name: jobName
type: string
default: PackWPF
- name: variables
type: object
default: {}
- name: publishArtifacts
type: boolean
default: true
jobs:
- job: ${{ parameters.jobName }}
${{ if ne(length(parameters.pool), 0) }}:
pool: ${{ parameters.pool }}
${{ if eq(parameters.codeSign, true) }}:
displayName: Pack and Sign Microsoft.Terminal.Wpf
${{ else }}:
displayName: Pack Microsoft.Terminal.Wpf
strategy:
matrix:
${{ each config in parameters.buildConfigurations }}:
${{ config }}:
BuildConfiguration: ${{ config }}
dependsOn: ${{ parameters.dependsOn }}
variables:
OutputBuildPlatform: AnyCPU
Terminal.BinDir: $(Build.SourcesDirectory)/bin/$(OutputBuildPlatform)/$(BuildConfiguration)
JobOutputDirectory: $(Build.ArtifactStagingDirectory)\nupkg
JobOutputArtifactName: wpf-nupkg-$(BuildConfiguration)${{ parameters.artifactStem }}
${{ insert }}: ${{ parameters.variables }}
steps:
- checkout: self
clean: true
fetchDepth: 1
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
submodules: true
persistCredentials: True
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- template: steps-download-bin-dir-artifact.yml
parameters:
buildPlatforms:
- ${{ parameters.buildPlatforms }}
- Any CPU # Make sure we grab the precompiled WPF bits
# This build is already matrix'd on configuration, so
# just pass a single config into the download template.
buildConfigurations:
- $(BuildConfiguration)
artifactStem: ${{ parameters.artifactStem }}
- template: .\steps-restore-nuget.yml
- task: VSBuild@1
displayName: Build solution OpenConsole.sln for WPF Control (Pack)
inputs:
solution: 'OpenConsole.sln'
msbuildArgs: >-
/p:WindowsTerminalReleaseBuild=true;Version=$(XES_PACKAGEVERSIONNUMBER)
/p:NoBuild=true
/p:IncludeSymbols=true
/t:Terminal\wpf\WpfTerminalControl:Pack
platform: Any CPU
configuration: $(BuildConfiguration)
maximumCpuCount: true
clean: false
- task: CopyFiles@2
displayName: Copy *.nupkg to Artifacts
inputs:
Contents: 'bin/**/*Wpf*.nupkg'
TargetFolder: $(Build.ArtifactStagingDirectory)/nupkg
OverWrite: true
flattenFolders: true
- ${{ if eq(parameters.codeSign, true) }}:
- task: EsrpCodeSigning@3
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"
}
]
- ${{ if eq(parameters.generateSbom, true) }}:
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: 'Generate SBOM manifest (wpf)'
inputs:
BuildDropPath: '$(System.ArtifactsDirectory)/nupkg'
BuildComponentPath: '$(Build.SourcesDirectory)/bin'
- task: DropValidatorTask@0
displayName: 'Validate wpf SBOM manifest'
inputs:
BuildDropPath: '$(System.ArtifactsDirectory)/nupkg'
OutputPath: 'output.json'
ValidateSignature: true
Verbosity: 'Verbose'
- ${{ if eq(parameters.publishArtifacts, true) }}:
- publish: $(JobOutputDirectory)
artifact: $(JobOutputArtifactName)
displayName: Publish nupkg