forked from microsoft/calculator
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpackage-msixbundle.yaml
More file actions
204 lines (187 loc) · 8.86 KB
/
Copy pathpackage-msixbundle.yaml
File metadata and controls
204 lines (187 loc) · 8.86 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# This template contains a job which takes .msix packages which were built separately for each
# architecture (arm, x86, etc.) and combines them into a single .msixbundle. In release builds,
# this job also signs the bundle and creates StoreBroker packages.
parameters:
signBundle: false
createStoreBrokerPackages: false
jobs:
- job: Package
dependsOn:
- Buildx64
- Buildx86
- BuildARM
- BuildARM64
condition: |
and
(
in(dependencies.Buildx64.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
in(dependencies.Buildx86.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
in(dependencies.BuildARM.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
in(dependencies.BuildARM64.result, 'Succeeded', 'SucceededWithIssues', 'Skipped')
)
variables:
skipComponentGovernanceDetection: true
StoreBrokerMediaRootPath: $(TEMP)\SBMedia
StoreBrokerPackagePath: $(Build.ArtifactStagingDirectory)\storeBrokerPayload
PackageX86: $[in(dependencies.Buildx86.result, 'Succeeded', 'SucceededWithIssues')]
PackageX64: $[in(dependencies.Buildx64.result, 'Succeeded', 'SucceededWithIssues')]
PackageARM: $[in(dependencies.BuildARM.result, 'Succeeded', 'SucceededWithIssues')]
PackageARM64: $[in(dependencies.BuildARM64.result, 'Succeeded', 'SucceededWithIssues')]
templateContext:
outputs:
- ${{ if eq(parameters.signBundle, false) }}:
- output: pipelineArtifact
displayName: Publish MsixBundle artifact
targetPath: $(Build.ArtifactStagingDirectory)\msixBundle
artifactName: msixBundle
- ${{ else }}:
- output: pipelineArtifact
displayName: Publish MsixBundleSigned artifact
targetPath: $(Build.ArtifactStagingDirectory)\msixBundle
artifactName: msixBundleSigned
- ${{ if eq(parameters.createStoreBrokerPackages, true) }}:
- output: pipelineArtifact
displayName: Publish StoreBroker Payload artifact
targetPath: $(StoreBrokerPackagePath)
artifactName: storeBrokerPayload
steps:
- checkout: self
fetchDepth: 1
- task: DownloadPipelineArtifact@2
displayName: Download all .msix artifacts (x86)
condition: and(succeeded(), eq(variables.PackageX86, 'true'))
inputs:
artifactName: drop-x86
itemPattern: '**/*.msix'
targetPath: $(Build.ArtifactStagingDirectory)\drop\x86
- task: DownloadPipelineArtifact@2
displayName: Download all .msix artifacts (x64)
condition: and(succeeded(), eq(variables.PackageX64, 'true'))
inputs:
artifactName: drop-x64
itemPattern: '**/*.msix'
targetPath: $(Build.ArtifactStagingDirectory)\drop\x64
- task: DownloadPipelineArtifact@2
displayName: Download all .msix artifacts (ARM)
condition: and(succeeded(), eq(variables.PackageARM, 'true'))
inputs:
artifactName: drop-ARM
itemPattern: '**/*.msix'
targetPath: $(Build.ArtifactStagingDirectory)\drop\ARM
- task: DownloadPipelineArtifact@2
displayName: Download all .msix artifacts (ARM64)
condition: and(succeeded(), eq(variables.PackageARM64, 'true'))
inputs:
artifactName: drop-ARM64
itemPattern: '**/*.msix'
targetPath: $(Build.ArtifactStagingDirectory)\drop\ARM64
- ${{ if or(eq(parameters.createStoreBrokerPackages, true), eq(parameters.signBundle, true)) }}:
- task: UniversalPackages@0
displayName: Download internals package
inputs:
command: download
downloadDirectory: $(Build.SourcesDirectory)
vstsFeed: WindowsInboxApps
vstsFeedPackage: calculator-internals
vstsPackageVersion: 0.0.119
- task: PowerShell@2
displayName: Generate MsixBundle mapping
inputs:
filePath: $(Build.SourcesDirectory)\build\scripts\CreateMsixBundleMapping.ps1
arguments: '-InputPath $(Build.ArtifactStagingDirectory)\drop -ProjectName Calculator -OutputFile $(Build.BinariesDirectory)\MsixBundleMapping.txt'
- powershell: |
$buildVersion = [version]$Env:BUILDVERSION
$bundleVersion = "2021.$($buildVersion.Minor).$($buildVersion.Build).$($buildVersion.Revision)"
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\MakeAppx.exe" bundle /v /bv $bundleVersion /f $Env:MAPPINGFILEPATH /p $Env:OUTPUTPATH
displayName: Make MsixBundle
env:
BUILDVERSION: $(Build.BuildNumber)
MAPPINGFILEPATH: $(Build.BinariesDirectory)\MsixBundleMapping.txt
OUTPUTPATH: $(Build.BinariesDirectory)\Microsoft.WindowsCalculator_8wekyb3d8bbwe.msixbundle
- task: CopyFiles@2
displayName: Copy MsixBundle to staging directory
inputs:
sourceFolder: $(Build.BinariesDirectory)
contents: Microsoft.WindowsCalculator_8wekyb3d8bbwe.msixbundle
targetFolder: $(Build.ArtifactStagingDirectory)\msixBundle
- ${{ if eq(parameters.signBundle, true) }}:
- pwsh: |
$configPath = "$(Build.SourcesDirectory)\Tools\Build\Signing\ESRP-codesign.json"
$config = Get-Content -Raw $configPath | ConvertFrom-Json
$esrpAppRegClientId = $config.AppRegistrationClientId
$esrpAppRegTenantId = $config.AppRegistrationClientId
$esrpClientId = $config.EsrpClientId
echo AppRegistrationClientId:$esrpAppRegClientId, AppRegTenantId:$esrpAppRegTenantId, EsrpClientId:$esrpClientId
echo "##vso[task.setvariable variable=EsrpAppRegClientId]$esrpAppRegClientId"
echo "##vso[task.setvariable variable=EsrpAppRegTenantId]$esrpAppRegTenantId"
echo "##vso[task.setvariable variable=EsrpClientId]$esrpClientId"
displayName: Get ESRP config
- task: EsrpCodeSigning@5
displayName: Send msixbundle to code signing service
inputs:
ConnectedServiceName: Essential Experiences Codesign PME
UseMSIAuthentication: true
AppRegistrationClientId: $(EsrpAppRegClientId)
AppRegistrationTenantId: $(EsrpAppRegTenantId)
EsrpClientId: $(EsrpClientId)
AuthAKVName: EE-Apps-CodeSign-KV
AuthCertName: EE-Auth-Cert
AuthSignCertName: EE-Codesign-Cert
FolderPath: $(Build.ArtifactStagingDirectory)\msixBundle
Pattern: Microsoft.WindowsCalculator_8wekyb3d8bbwe.msixbundle
signConfigType: inlineSignParams
inlineOperation: |
[
{
"CertTemplateName": "WINMSAPP1ST",
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
"KeyCode": "Dynamic",
"OperationCode": "SigntoolvNextSign",
"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"
},
{
"CertTemplateName": "WINMSAPP1ST",
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
"KeyCode": "Dynamic",
"OperationCode": "SigntoolvNextVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- ${{ if eq(parameters.createStoreBrokerPackages, true) }}:
- powershell: |
# Just modify this line to indicate where your en-us PDP file is. Leave the other lines alone.
$enUSPdpFilePath = "$(Build.SourcesDirectory)\PDP\en-US\PDP.xml"
# This is going to save the release value from the PDP file to $(SBMediaReleaseVersion)
# which you can then refer to in the UniversalPackages task.
$release = ([xml](Get-Content $enUSPdpFilePath)).ProductDescription.Release.Trim()
Write-Host "##vso[task.setvariable variable=SBMediaReleaseVersion;]$release"
displayName: Determine the PDP Media release version from the en-us PDP file
- task: UniversalPackages@0
displayName: Download PDP media (screenshots, trailers) universal package
inputs:
command: download
downloadDirectory: $(StoreBrokerMediaRootPath)/$(SBMediaReleaseVersion)
vstsFeed: WindowsInboxApps
vstsFeedPackage: calculator-pdp-media
vstsPackageVersion: $(SBMediaReleaseVersion)
- task: MS-RDX-MRO.windows-store-publish-dev.package-task.store-package@3
displayName: Create StoreBroker Payload
inputs:
serviceEndpoint: Calculator StoreBroker FC
sbConfigPath: Tools/Build/StoreBroker/SBCalculatorConfig.json
sourceFolder: $(Build.ArtifactStagingDirectory)/msixBundle
contents: Microsoft.WindowsCalculator_8wekyb3d8bbwe.msixbundle
pdpPath: $(Build.SourcesDirectory)\PDP
pdpInclude: PDP.xml
pdpMediaPath: $(StoreBrokerMediaRootPath)
outSBPackagePath: $(StoreBrokerPackagePath)
outSBName: SBCalculator