Skip to content
Merged
9 changes: 8 additions & 1 deletion tools/releaseBuild/azureDevOps/releasePipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
70 changes: 70 additions & 0 deletions tools/releaseBuild/azureDevOps/templates/release-MsixBundle.yml
Original file line number Diff line number Diff line change
@@ -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