Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .pipelines/PowerShell-Packages-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ variables:
value: $[format('{0:yyyyMMdd}-{1}', pipeline.startTime,variables['Build.SourceBranch'])]
- name: branchCounter
value: $[counter(variables['branchCounterKey'], 1)]
- group: MSIXSigningProfile

resources:
pipelines:
Expand Down Expand Up @@ -246,7 +247,13 @@ extends:
jobs:
- template: /.pipelines/templates/nupkg.yml@self

- stage: msixbundle
displayName: 'Create MSIX Bundle'
dependsOn: [windows_package]
jobs:
- template: /.pipelines/templates/package-create-msix.yml@self

- stage: upload
dependsOn: [mac_package, windows_package, linux_package, nupkg]
dependsOn: [mac_package, windows_package, linux_package, nupkg, msixbundle]
jobs:
- template: /.pipelines/templates/uploadToAzure.yml@self
8 changes: 0 additions & 8 deletions .pipelines/PowerShell-Release-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ variables:
- name: ReleaseTagVar
value: ${{ parameters.ReleaseTagVar }}
- group: PoolNames
- group: MSIXSigningProfile

resources:
repositories:
Expand Down Expand Up @@ -122,12 +121,6 @@ extends:
jobs:
- template: /.pipelines/templates/release-SetTagAndChangelog.yml@self

- stage: msixbundle
displayName: 'Create MSIX Bundle'
dependsOn: []
jobs:
- template: /.pipelines/templates/release-create-msix.yml@self

- stage: validateSdk
displayName: 'Validate SDK'
dependsOn: []
Expand Down Expand Up @@ -270,7 +263,6 @@ extends:
- fxdpackages
- gbltool
- validateSdk
- msixbundle

jobs:
- template: /.pipelines/templates/approvalJob.yml@self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,32 @@ jobs:
steps:
- template: release-SetReleaseTagandContainerName.yml@self

- download: PSPackagesOfficial
artifact: drop_windows_package_package_win_arm64
displayName: Download arm64 msix
patterns: '**/*.msix'

- download: PSPackagesOfficial
artifact: drop_windows_package_package_win_x64
displayName: Download x64 msix
patterns: '**/*.msix'

- download: PSPackagesOfficial
artifact: drop_windows_package_package_win_x86
displayName: Download x86 msix
patterns: '**/*.msix'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifact: drop_windows_package_package_win_arm64
itemPattern: |
**/*.msix
targetPath: '$(Build.ArtifactStagingDirectory)/downloads'
displayName: Download windows arm64 packages

- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifact: drop_windows_package_package_win_x64
itemPattern: |
**/*.msix
targetPath: '$(Build.ArtifactStagingDirectory)/downloads'
displayName: Download windows x64 packages

- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifact: drop_windows_package_package_win_x86
itemPattern: |
**/*.msix
targetPath: '$(Build.ArtifactStagingDirectory)/downloads'
displayName: Download windows x86 packages

# Finds the makeappx tool on the machine with image: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'
- pwsh: |
Expand All @@ -53,7 +65,7 @@ jobs:
$sourceDir = '$(Pipeline.Workspace)\releasePipeline\msix'
$null = New-Item -Path $sourceDir -ItemType Directory -Force

$msixFiles = Get-ChildItem -Path "$(Pipeline.Workspace)/PSPackagesOfficial/*.msix" -Recurse
$msixFiles = Get-ChildItem -Path "$(Build.ArtifactStagingDirectory)/downloads/*.msix" -Recurse
foreach ($msixFile in $msixFiles) {
$null = Copy-Item -Path $msixFile.FullName -Destination $sourceDir -Force -Verbose
}
Expand Down Expand Up @@ -87,43 +99,12 @@ jobs:
$signedBundle = Get-ChildItem -Path $(BundleDir) -Filter "*.msixbundle" -File
Write-Verbose -Verbose "Signed bundle: $signedBundle"

# Ensure the destination directory exists
if (-not (Test-Path -Path "$(ob_outputDirectory)")) {
Write-Verbose -Verbose "Creating destination directory: $(ob_outputDirectory)"
New-Item -Path "$(ob_outputDirectory)" -ItemType Directory -Force | Out-Null
if (-not (Test-Path $(ob_outputDirectory))) {
New-Item -ItemType Directory -Path $(ob_outputDirectory) -Force
}

Copy-Item -Path $signedBundle.FullName -Destination "$(ob_outputDirectory)\$($signedBundle.Name)" -Verbose
Copy-Item -Path $signedBundle.FullName -Destination "$(ob_outputDirectory)" -Verbose

Write-Verbose -Verbose "Uploaded Bundle:"
Get-ChildItem -Path $(ob_outputDirectory) | Write-Verbose -Verbose
displayName: Upload msixbundle to Artifacts

- task: AzurePowerShell@5
displayName: Upload msix to blob
inputs:
azureSubscription: az-blob-cicd-infra
scriptType: inlineScript
azurePowerShellVersion: LatestVersion
pwsh: true
inline: |
$containerName = '$(OutputVersion.AzureVersion)-private'
$storageAccount = '$(StorageAccount)'

$storageContext = New-AzStorageContext -StorageAccountName $storageAccount -UseConnectedAccount

if ($env:BundleDir) {
$bundleFile = Get-Item "$env:BundleDir\*.msixbundle"
$blobName = $bundleFile | Split-Path -Leaf
$existing = Get-AzStorageBlob -Container $containerName -Blob $blobName -Context $storageContext -ErrorAction Ignore
if ($existing) {
Write-Verbose -Verbose "MSIX bundle already exists at '$storageAccount/$containerName/$blobName', removing first."
$existingBlob | Remove-AzStorageBlob -ErrorAction Stop -Verbose
}

Write-Verbose -Verbose "Uploading $bundleFile to $containerName/$blobName"
Set-AzStorageBlobContent -File $bundleFile -Container $containerName -Blob $blobName -Context $storageContext -Force
}
else{
throw "BundleDir not found"
}
35 changes: 35 additions & 0 deletions .pipelines/templates/uploadToAzure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
value: $(Build.SourcesDirectory)\PowerShell\.config\suppress.json
- name: ob_sdl_codeql_compiled_enabled
value: false
- group: 'Azure Blob variable group'

steps:
- checkout: self
Expand All @@ -38,6 +39,8 @@ jobs:
CreateJson: yes
UseJson: no

- template: /.pipelines/templates/release-SetReleaseTagandContainerName.yml@self

- template: /.pipelines/templates/cloneToOfficialPath.yml@self

- pwsh: |
Expand Down Expand Up @@ -231,6 +234,15 @@ jobs:
targetPath: '$(Build.ArtifactStagingDirectory)/downloads'
displayName: Download macos x64 packages

- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifact: drop_msixbundle_CreateMSIXBundle
itemPattern: |
**/*.msixbundle
targetPath: '$(Build.ArtifactStagingDirectory)/downloads'
displayName: Download MSIXBundle

- pwsh: |
Get-ChildItem '$(Build.ArtifactStagingDirectory)/downloads' | Select-Object -ExpandProperty FullName
displayName: 'Capture downloads'
Expand Down Expand Up @@ -397,3 +409,26 @@ jobs:
Write-Host "File $blobName uploaded to $containerName container."
Move-Item -Path $_.FullName -Destination $uploadedDirectory -Force -Verbose
}

$msixbundleFiles = Get-ChildItem -Path $downloadsDirectory -Filter "*.msixbundle"

$containerName = '$(OutputVersion.AzureVersion)-private'
$storageAccount = '$(StorageAccount)'

$storageContext = New-AzStorageContext -StorageAccountName $storageAccount -UseConnectedAccount

if ($msixbundleFiles) {
$bundleFile = $msixbundleFiles[0].FullName
$blobName = $msixbundleFiles[0].Name

$existing = Get-AzStorageBlob -Container $containerName -Blob $blobName -Context $storageContext -ErrorAction Ignore
if ($existing) {
Write-Verbose -Verbose "MSIX bundle already exists at '$storageAccount/$containerName/$blobName', removing first."
$existing | Remove-AzStorageBlob -ErrorAction Stop -Verbose
}

Write-Verbose -Verbose "Uploading $bundleFile to $containerName/$blobName"
Set-AzStorageBlobContent -File $bundleFile -Container $containerName -Blob $blobName -Context $storageContext -Force
} else {
throw "MSIXBundle not found in $downloadsDirectory"
}
Loading