calculator/build/pipelines/templates/package-msixbundle.yaml

158 lines
6.5 KiB
YAML
Raw Normal View History

# 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.
2019-01-29 08:24:37 +08:00
parameters:
2022-02-24 13:29:03 +08:00
isOSSBuild: false
signBundle: false
createStoreBrokerPackages: false
2019-01-29 08:24:37 +08:00
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')
2019-01-29 08:24:37 +08:00
)
pool:
2022-02-24 13:29:03 +08:00
${{ if eq(parameters.isOSSBuild, true) }}:
name: EssentialExperiencesOpenSource-windows-2022
${{ if eq(parameters.isOSSBuild, false) }}:
name: EssentialExperiences-windows-2022
variables:
skipComponentGovernanceDetection: true
StoreBrokerMediaRootPath: $(TEMP)\SBMedia
StoreBrokerPackagePath: $(Build.ArtifactStagingDirectory)\storeBrokerPayload
2019-01-29 08:24:37 +08:00
steps:
- checkout: self
2020-10-29 05:41:13 +08:00
fetchDepth: 1
2019-01-29 08:24:37 +08:00
- task: DownloadBuildArtifacts@0
displayName: Download all .msix artifacts
2019-01-29 08:24:37 +08:00
inputs:
artifactName: drop
itemPattern: '**/*.msix'
2019-01-29 08:24:37 +08:00
- ${{ if eq(parameters.createStoreBrokerPackages, true) }}:
- task: UniversalPackages@0
displayName: Download internals package
inputs:
command: download
downloadDirectory: $(Build.SourcesDirectory)
vstsFeed: WindowsInboxApps
vstsFeedPackage: calculator-internals
vstsPackageVersion: 0.0.78
2019-01-29 08:24:37 +08:00
- task: PowerShell@2
displayName: Generate MsixBundle mapping
2019-01-29 08:24:37 +08:00
inputs:
filePath: $(Build.SourcesDirectory)\build\scripts\CreateMsixBundleMapping.ps1
arguments: '-InputPath $(Build.ArtifactStagingDirectory)\drop\Release -ProjectName Calculator -OutputFile $(Build.BinariesDirectory)\MsixBundleMapping.txt'
2019-01-29 08:24:37 +08:00
- powershell: |
$buildVersion = [version]$Env:BUILDVERSION
2021-09-29 04:55:19 +08:00
$bundleVersion = "2021.$($buildVersion.Minor).$($buildVersion.Build).$($buildVersion.Revision)"
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\MakeAppx.exe" bundle /v /bv $bundleVersion /f $Env:MAPPINGFILEPATH /p $Env:OUTPUTPATH
displayName: Make MsixBundle
2019-01-29 08:24:37 +08:00
env:
BUILDVERSION: $(Build.BuildNumber)
MAPPINGFILEPATH: $(Build.BinariesDirectory)\MsixBundleMapping.txt
OUTPUTPATH: $(Build.BinariesDirectory)\Microsoft.WindowsCalculator_8wekyb3d8bbwe.msixbundle
2019-01-29 08:24:37 +08:00
- task: CopyFiles@2
displayName: Copy MsixBundle to staging directory
2019-01-29 08:24:37 +08:00
inputs:
sourceFolder: $(Build.BinariesDirectory)
contents: Microsoft.WindowsCalculator_8wekyb3d8bbwe.msixbundle
targetFolder: $(Build.ArtifactStagingDirectory)\msixBundle
2019-01-29 08:24:37 +08:00
- task: PublishBuildArtifacts@1
displayName: Publish MsixBundle artifact
2019-01-29 08:24:37 +08:00
inputs:
artifactName: msixBundle
pathToPublish: $(Build.ArtifactStagingDirectory)\msixBundle
- ${{ if eq(parameters.signBundle, true) }}:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: Send msixbundle to code signing service
inputs:
ConnectedServiceName: Essential Experiences Codesign
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"
}
]
- task: PublishBuildArtifacts@1
displayName: Publish MsixBundleSigned artifact
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)\msixBundle
artifactName: msixBundleSigned
- ${{ 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@2
displayName: Create StoreBroker Payload
inputs:
serviceEndpoint: Calculator StoreBroker Connection
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
- task: PublishBuildArtifacts@1
displayName: Publish StoreBroker Payload artifact
inputs:
pathtoPublish: $(StoreBrokerPackagePath)
artifactName: storeBrokerPayload