Skip to content

Commit

Permalink
Create and push Microsoft.UI.Xaml vpack as part of Release Build (#6131)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmahone authored Oct 20, 2021
1 parent 31c9be3 commit 51cf944
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ steps:
- template: MUX-MakeFrameworkPackages-Steps.yml
parameters:
buildOutputDir: $(buildOutputDir)
signOutput: ${{parameters.signOutput}}
40 changes: 40 additions & 0 deletions build/AzurePipelinesTemplates/MUX-MakeFrameworkPackages-Steps.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
parameters:
buildOutputDir: '$(Build.SourcesDirectory)\Artifacts\drop'
signOutput: false

steps:
- powershell: |
Expand All @@ -25,3 +26,42 @@ steps:
}
}
displayName: 'Make FrameworkPackages'
- ${{ if eq( parameters.signOutput, true) }}:
- task: EsrpCodeSigning@1
displayName: First Party StoreSign Framework Package
inputs:
ConnectedServiceName: WinUISigning
FolderPath: '${{ parameters.buildOutputDir }}\$(buildConfiguration)\$(buildPlatform)\FrameworkPackage'
Pattern: |
*.appx
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"
}
]
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'
14 changes: 14 additions & 0 deletions build/AzurePipelinesTemplates/MUX-PushCBSVpack-Job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ jobs:
failOnStderr: true
# Note: This task sets the 'vpackversion' variable that is used below.
- task: PublishBuildArtifacts@1
displayName: Publish WinUIVpack Artifact
inputs:
PathtoPublish: $(System.ArtifactsDirectory)\drop\release\WinUIVpack
artifactName: WinUIVpack
# This artifact is not consumed by anyone, but it is useful for debugging purposes.

- task: PublishBuildArtifacts@1
displayName: Publish CBS Artifact
inputs:
Expand All @@ -46,6 +53,13 @@ jobs:
# This artifact is not consumed by anyone, but it is useful for debugging purposes.

# Push the VPacks:
- task: PkgESVPack@12
displayName: 'Push VPack Microsoft.UI.Xaml'
inputs:
sourceDirectory: '$(System.ArtifactsDirectory)\drop\Release\WinUIVpack'
description: Microsoft.UI.Xaml
pushPkgName: Microsoft.UI.Xaml
version: $(vpackversion)
- task: PkgESVPack@12
displayName: 'Push VPack MicrosoftUIXamlInbox_x64'
inputs:
Expand Down
35 changes: 34 additions & 1 deletion build/CreateCBSVPack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if(!(Get-Command mdmerge -ErrorAction Ignore))
Write-Error "Cannot find mdmerge. Make sure to run from a Developer Command Prompt."
exit 1
}

$winuiVpackFolder = "$releaseFolder\WinUIVpack"
$cbsFolder = "$releaseFolder\CBS"
$winmdFolder = "$cbsFolder\winmd"
$packagesDir = Join-Path $repoRoot "packages"
Expand All @@ -81,12 +81,19 @@ if (Test-Path $cbsFolder)
Remove-Item -Path $cbsFolder -Force -Recurse| Out-Null
}

if (Test-Path $winuiVpackFolder)
{
Write-Host "Deleting $winuiVpackFolder"
Remove-Item -Path $winuiVpackFolder -Force -Recurse| Out-Null
}

if (Test-Path $winmdReferencesDir)
{
Write-Host "Deleting $winmdReferencesDir"
Remove-Item -Path $winmdReferencesDir -Force -Recurse| Out-Null
}

New-Item -Path "$winuiVpackFolder" -ItemType Directory | Out-Null
New-Item -Path "$cbsFolder" -ItemType Directory | Out-Null
New-Item -Path "$winmdFolder" -ItemType Directory | Out-Null
New-Item -Path "$winmdReferencesDir" -ItemType Directory | Out-Null
Expand All @@ -112,6 +119,32 @@ foreach ($flavour in $buildFlavours)
}
}

# Create WinUI Vpack:
foreach ($flavour in $buildFlavours)
{
$sourceFolder = "$releaseFolder\$flavour\FrameworkPackage"
$targetFolder = "$winuiVpackFolder\$flavour"

New-Item -Path "$targetFolder" -ItemType Directory | Out-Null

$search = "Microsoft.UI.Xaml.*.appx"
$found = Get-ChildItem $sourceFolder -Filter $search
if ($found.Length -eq 0)
{
Write-Error "Could not find '$search' in '$sourceFolder'"
Exit 1
}

$fileName = $found[0].Name
$sourcePathFull = $found[0].FullName

$destPathFull = Join-Path $targetFolder $fileName

Write-Verbose "Copy item from '$sourcePathFull' to '$destPathFull' "
Copy-Item $sourcePathFull $destPathFull
}

# Create CBS Vpacks:
foreach ($flavour in $buildFlavours)
{
$sourceFolder = "$releaseFolder\$flavour"
Expand Down

0 comments on commit 51cf944

Please sign in to comment.