103 lines
3.9 KiB
YAML
103 lines
3.9 KiB
YAML
# This template contains a job which takes .appx packages which were built separately for each
|
|
# architecture (arm, x86, etc.) and combines them into a single .appxbundle.
|
|
|
|
parameters:
|
|
signBundle: false
|
|
|
|
jobs:
|
|
- job: Package
|
|
dependsOn:
|
|
- Buildx64
|
|
- Buildx86
|
|
- BuildARM
|
|
condition: |
|
|
and
|
|
(
|
|
in(dependencies.Buildx64.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
|
|
in(dependencies.Buildx86.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
|
|
in(dependencies.BuildARM.result, 'Succeeded', 'SucceededWithIssues', 'Skipped')
|
|
)
|
|
pool:
|
|
vmImage: windows-2019
|
|
workspace:
|
|
clean: outputs
|
|
variables:
|
|
skipComponentGovernanceDetection: true
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
displayName: Download all .appx artifacts
|
|
inputs:
|
|
artifactName: drop
|
|
itemPattern: '**/*.appx'
|
|
|
|
- task: PowerShell@2
|
|
displayName: Generate AppxBundle mapping
|
|
inputs:
|
|
filePath: $(Build.SourcesDirectory)\build\scripts\CreateAppxBundleMapping.ps1
|
|
arguments: '-InputPath $(Build.ArtifactStagingDirectory)\drop\Release -ProjectName Calculator -OutputFile $(Build.BinariesDirectory)\AppxBundleMapping.txt'
|
|
|
|
- powershell: |
|
|
$buildVersion = [version]$Env:BUILDVERSION
|
|
$bundleVersion = "2020.$($buildVersion.Minor).$($buildVersion.Build).$($buildVersion.Revision)"
|
|
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86\MakeAppx.exe" bundle /v /bv $bundleVersion /f $Env:MAPPINGFILEPATH /p $Env:OUTPUTPATH
|
|
displayName: Make AppxBundle
|
|
env:
|
|
BUILDVERSION: $(Build.BuildNumber)
|
|
MAPPINGFILEPATH: $(Build.BinariesDirectory)\AppxBundleMapping.txt
|
|
OUTPUTPATH: $(Build.BinariesDirectory)\Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle
|
|
|
|
- task: CopyFiles@2
|
|
displayName: Copy AppxBundle to staging directory
|
|
inputs:
|
|
sourceFolder: $(Build.BinariesDirectory)
|
|
contents: Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle
|
|
targetFolder: $(Build.ArtifactStagingDirectory)\appxBundle
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: Publish AppxBundle artifact
|
|
inputs:
|
|
artifactName: appxBundle
|
|
pathToPublish: $(Build.ArtifactStagingDirectory)\appxBundle
|
|
|
|
- ${{ if eq(parameters.signBundle, true) }}:
|
|
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
|
displayName: Send appxbundle to code signing service
|
|
inputs:
|
|
ConnectedServiceName: Essential Experiences Codesign
|
|
FolderPath: $(Build.ArtifactStagingDirectory)\appxBundle
|
|
Pattern: Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle
|
|
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"
|
|
}
|
|
]
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: Publish AppxBundleSigned artifact
|
|
inputs:
|
|
pathtoPublish: $(Build.ArtifactStagingDirectory)\appxBundle
|
|
artifactName: appxBundleSigned |