Skip to content

Commit

Permalink
Remove logics from the packaging pipeline related to uploading packag…
Browse files Browse the repository at this point in the history
…es to Azure blob (#295)
  • Loading branch information
daxian-dbw authored Nov 14, 2024
1 parent 48e35e9 commit 64cdfaa
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 333 deletions.
23 changes: 0 additions & 23 deletions .pipelines/Package-Official.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
trigger: none

parameters: # parameters are shown up in ADO UI in a build queue time
- name: ForceAzureBlobDelete
displayName: Delete Azure Blob
type: string
values:
- true
- false
default: false
- name: 'debug'
displayName: 'Enable debug output'
type: boolean
Expand All @@ -20,8 +13,6 @@ variables:
value: ${{ parameters.debug }}
- name: ENABLE_PRS_DELAYSIGN
value: 1
- name: ForceAzureBlobDelete
value: ${{ parameters.ForceAzureBlobDelete }}
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
- name: WindowsContainerImage
Expand Down Expand Up @@ -87,12 +78,7 @@ extends:
tsaOptionsFile: .config\tsaoptions.json

stages:
- stage: prep
jobs:
- template: /.pipelines/templates/check-Azure-container.yml@self

- stage: mac
dependsOn: [prep]
jobs:
- template: /.pipelines/templates/mac-package.yml@self
parameters:
Expand All @@ -102,7 +88,6 @@ extends:
architecture: arm64

- stage: windows
dependsOn: [prep]
jobs:
- template: /.pipelines/templates/windows-package.yml@self
parameters:
Expand All @@ -115,7 +100,6 @@ extends:
architecture: arm64

- stage: linux
dependsOn: [prep]
jobs:
- template: /.pipelines/templates/linux-package.yml@self
parameters:
Expand All @@ -125,16 +109,9 @@ extends:
architecture: arm64

- stage: module
dependsOn: [prep]
jobs:
- template: /.pipelines/templates/module-package.yml@self

- stage: nupkg
dependsOn: [prep]
jobs:
- template: /.pipelines/templates/nupkg-package.yml@self

- stage: upload
dependsOn: [mac, windows, linux, module, nupkg]
jobs:
- template: /.pipelines/templates/upload-to-Azure.yml@self
101 changes: 0 additions & 101 deletions .pipelines/templates/check-Azure-container.yml

This file was deleted.

47 changes: 12 additions & 35 deletions .pipelines/templates/release-msix-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- group: msixTools
- group: 'Azure Blob variable group'
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
value: '$(Build.ArtifactStagingDirectory)\ONEBRANCH_ARTIFACT'

steps:
- download: AIShellPackagePipeline
Expand Down Expand Up @@ -76,39 +76,16 @@ jobs:
retryCountOnTaskFailure: 1
- pwsh: |
$azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose
if ($azureRmModule) {
Write-Host 'AzureRM module exists. Removing it'
Uninstall-AzureRm
Write-Host 'AzureRM module removed'
if (-not (Test-Path '$(ob_outputDirectory)')) {
New-Item -ItemType Directory -Path '$(ob_outputDirectory)' -Force
}
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
displayName: Remove AzRM modules and install Az.Storage
- task: AzurePowerShell@5
displayName: Upload msix to blob
inputs:
azureSubscription: az-blob-cicd-infra
scriptType: inlineScript
azurePowerShellVersion: LatestVersion
pwsh: true
inline: |
$containerName = 'aish'
$storageAccount = '$(PSInfraStorageAccount)'
$storageContext = New-AzStorageContext -StorageAccountName $storageAccount -UseConnectedAccount
if ($env:BundleDir) {
$bundleFile = (Get-Item "$env:BundleDir\*.msixbundle").FullName
$fileName = $bundleFile | Split-Path -Leaf
$version = [System.IO.Path]::GetFileNameWithoutExtension($fileName).Replace('AIShell-', '')
$blobName = "$version/$fileName"
Write-Verbose -Verbose "Uploading $bundleFile to $containerName/$blobName"
$null = Set-AzStorageBlobContent -File $bundleFile -Container $containerName -Blob $blobName -Context $storageContext
}
else{
throw "BundleDir not found"
}
Write-Verbose -Verbose "Copying msixbundle to output directory"
if ($env:BundleDir) {
$bundleFile = (Get-Item "$env:BundleDir\*.msixbundle").FullName
Copy-Item -Path $bundleFile -Destination '$(ob_outputDirectory)' -Force -Verbose
}
else{
throw "BundleDir not found"
}
displayName: Copy msixbundle to output directory
Loading

0 comments on commit 64cdfaa

Please sign in to comment.