Create MSIX Bundle package in release pipeline (#14982)

This commit is contained in:
Dongbo Wang authored and GitHub committed 2021-03-15 10:00:43 -07:00
1 parent d62473f610
commit 05f7624c8c
2 files changed
+78 -1

No files matched your search

@@ -19,6 +19,12 @@ variables:
value: none
stages:
- stage: MSIXBundle
displayName: Create MSIX Bundle package
dependsOn: []
jobs:
- template: templates/release-MsixBundle.yml
- stage: ValidateSDK
displayName: Validate SDK
dependsOn: []
@@ -118,6 +124,7 @@ stages:
displayName: Create GitHub draft release
# do not include stages that are likely to fail in dependency as there is no way to force deploy.
dependsOn:
- MSIXBundle
- ValidateSDK
- PRCreation
- ValidatePkgNames
@@ -242,7 +249,7 @@ stages:
displayName: Publish MSIX to store
jobs:
- deployment: PublishMsix
displayName: Publish MSIX to store
displayName: Publish the MSIX Bundle package to store
pool: server
environment: PSReleasePublishMsix
@@ -0,0 +1,70 @@
jobs:
- job: CreateMSIXBundle
displayName: Create .msixbundle file
pool:
vmImage: windows-latest
variables:
- group: msixTools
- group: 'Azure Blob variable group'
steps:
- template: release-SetReleaseTagAndContainerName.yml
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: PowerShellCore
pipeline: '696'
preferTriggeringPipeline: true
runVersion: latestFromBranch
runBranch: '$(Build.SourceBranch)'
artifact: finalResults
patterns: '**/*.msix'
path: '$(Pipeline.Workspace)\releasePipeline\msix'
- pwsh: |
$cmd = Get-Command makeappx.exe -ErrorAction Ignore
if ($cmd) {
Write-Verbose -Verbose 'makeappx available in PATH'
$exePath = $cmd.Source
} else {
$toolsDir = '$(Pipeline.Workspace)\releasePipeline\tools'
New-Item $toolsDir -Type Directory -Force > $null
Invoke-RestMethod -Uri '$(makeappUrl)' -OutFile "$toolsDir\makeappx.zip"
Expand-Archive "$toolsDir\makeappx.zip" -DestinationPath "$toolsDir\makeappx" -Force
$exePath = "$toolsDir\makeappx\makeappx.exe"
Write-Verbose -Verbose 'makeappx was installed:'
Get-ChildItem -Path $toolsDir -Recurse
}
$vstsCommandString = "vso[task.setvariable variable=MakeAppxPath]$exePath"
Write-Host "sending " + $vstsCommandString
Write-Host "##$vstsCommandString"
displayName: Install makeappx tool
- pwsh: |
$sourceDir = '$(Pipeline.Workspace)\releasePipeline\msix'
$file = Get-ChildItem $sourceDir | Select-Object -First 1
$prefix = ($file.BaseName -split "-win")[0]
$pkgName = "$prefix.msixbundle"
Write-Verbose -Verbose "Creating $pkgName"
$makeappx = '$(MakeAppxPath)'
$outputDir = "$sourceDir\output"
New-Item $outputDir -Type Directory -Force > $null
& $makeappx bundle /d $sourceDir /p "$outputDir\$pkgName"
Get-ChildItem -Path $sourceDir -Recurse
$vstsCommandString = "vso[task.setvariable variable=BundleDir]$outputDir"
Write-Host "sending " + $vstsCommandString
Write-Host "##$vstsCommandString"
displayName: Create MsixBundle
- pwsh: |
## We use AzCopy v8.1 in our release pipeline, see the documentation at:
## https://docs.microsoft.com/en-us/previous-versions/azure/storage/storage-use-azcopy
$azcopy = "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe"
& $azcopy /Source:$(BundleDir) /Dest:https://$(StorageAccount).blob.core.windows.net/$(AzureVersion)-private /DestKey:$(StorageAccountKey) /Pattern:*.msixbundle
displayName: Upload MSIX Bundle package to Az Blob