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
24 changes: 21 additions & 3 deletions .pipelines/templates/package-create-msix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,32 @@ jobs:
}

Write-Host "##vso[task.setvariable variable=ServiceConnection]$($config.ServiceEndpoint)"
Write-Host "##vso[task.setvariable variable=SBConfigPath]$($config.SBConfigPath)"
Write-Host "##vso[task.setvariable variable=SBConfigPath]$($sbConfigPath)"

# These variables are used in the next tasks to determine which ServiceEndpoint to use
Write-Host "##vso[task.setvariable variable=LTS]$($IsLTS.ToString().ToLower())"
Write-Host "##vso[task.setvariable variable=STABLE]$($IsStable.ToString().ToLower())"
Write-Host "##vso[task.setvariable variable=PREVIEW]$($IsPreview.ToString().ToLower())"
name: UpdateConfigs
displayName: Update PDPs and SBConfig.json

- task: MS-RDX-MRO.windows-store-publish.package-task.store-package@3
displayName: 'Create StoreBroker Package'
displayName: 'Create StoreBroker Package (Preview)'
condition: eq('$(PREVIEW)', 'true')
inputs:
serviceEndpoint: 'StoreAppPublish-Preview'
sbConfigPath: '$(SBConfigPath)'
sourceFolder: '$(BundleDir)'
contents: '*.msixBundle'
outSBName: 'PowerShellStorePackage'
pdpPath: '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/PDP/PDP'
pdpMediaPath: '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/PDP/PDP-Media'

- task: MS-RDX-MRO.windows-store-publish.package-task.store-package@3
displayName: 'Create StoreBroker Package (Stable/LTS)'
condition: or(eq('$(STABLE)', 'true'), eq('$(LTS)', 'true'))
inputs:
serviceEndpoint: '$(ServiceConnection)'
serviceEndpoint: 'StoreAppPublish-Stable'
sbConfigPath: '$(SBConfigPath)'
sourceFolder: '$(BundleDir)'
contents: '*.msixBundle'
Expand Down
70 changes: 38 additions & 32 deletions .pipelines/templates/release-MSIX-Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
$middleURL = $matches[1]
}

$endURL = $tagString -replace '[v\.]',''
$endURL = $tagString -replace '^v','' -replace '\.',''
$message = "Changelog: https://github.com/PowerShell/PowerShell/blob/master/CHANGELOG/$middleURL.md#$endURL"
Write-Verbose -Verbose "Release Notes for the Store:"
Write-Verbose -Verbose "$message"
Expand All @@ -63,50 +63,56 @@ jobs:
inputs:
targetType: inline
script: |
Write-Verbose -Verbose "Channel Selection - LTS: $(LTS), Stable: $(Stable), Preview: $(Preview)"
$IsLTS = '$(LTS)' -eq 'true'
$IsStable = '$(STABLE)' -eq 'true'
$IsPreview = '$(PREVIEW)' -eq 'true'

# Define app configurations for each channel using secret variables
$channelConfigs = @{
'LTS' = @{
AppId = '$(AppID-LTS)'
ServiceEndpoint = 'StoreAppPublish-Stable'
}
'Stable' = @{
AppId = '$(AppID-Stable)'
ServiceEndpoint = 'StoreAppPublish-Stable'
}
'Preview' = @{
AppId = '$(AppID-Preview)'
ServiceEndpoint = 'StoreAppPublish-Preview'
}
}
Write-Verbose -Verbose "Channel Selection - LTS: $(LTS), Stable: $(Stable), Preview: $(Preview)"

# Determine the current channel
$currentChannel = if ($IsLTS) { 'LTS' }
elseif ($IsStable) { 'Stable' }
elseif ($IsPreview) { 'Preview' }
else {
Write-Error "No valid channel detected"
exit 1
}

$config = $channelConfigs[$currentChannel]

# Assign AppID for Store-Publish Task
$appID = $null
if ($IsLTS) {
$appID = '$(AppID-LTS)'
}
elseif ($IsStable) {
$appID = '$(AppID-Stable)'
}
else {
$appID = '$(AppID-Preview)'
}

Write-Host "##vso[task.setvariable variable=AppID]$appID"
Write-Verbose -Verbose "Selected channel: $currentChannel"
Write-Verbose -Verbose "App ID: $($config.AppId)"
Write-Verbose -Verbose "Service Endpoint: $($config.ServiceEndpoint)"

# Set pipeline variables for use in the store-publish task
Write-Host "##vso[task.setvariable variable=SelectedAppId]$($config.AppId)"
Write-Host "##vso[task.setvariable variable=SelectedServiceEndpoint]$($config.ServiceEndpoint)"
Write-Host "##vso[task.setvariable variable=SelectedChannel]$currentChannel"
displayName: 'Set StoreBroker Configurations'
Write-Verbose -Verbose "Conditional tasks will handle the publishing based on channel variables"
displayName: 'Validate Channel Selection'

- task: MS-RDX-MRO.windows-store-publish.publish-task.store-publish@3
displayName: 'Publish StoreBroker Package (Stable/LTS)'
condition: and(ne('${{ parameters.skipMSIXPublish }}', 'true'), or(eq('$(STABLE)', 'true'), eq('$(LTS)', 'true')))
inputs:
serviceEndpoint: 'StoreAppPublish-Stable'
appId: '$(AppID)'
inputMethod: JsonAndZip
jsonPath: '$(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.json'
zipPath: '$(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.zip'
numberOfPackagesToKeep: 2
jsonZipUpdateMetadata: true
targetPublishMode: 'Immediate'

- task: MS-RDX-MRO.windows-store-publish.publish-task.store-publish@3
displayName: 'Publish LTS StoreBroker Package'
condition: ne('${{ parameters.skipMSIXPublish }}', 'true')
displayName: 'Publish StoreBroker Package (Preview)'
condition: and(ne('${{ parameters.skipMSIXPublish }}', 'true'), eq('$(PREVIEW)', 'true'))
inputs:
serviceEndpoint: '$(SelectedServiceEndpoint)'
appId: '$(SelectedAppId)'
serviceEndpoint: 'StoreAppPublish-Preview'
appId: '$(AppID)'
inputMethod: JsonAndZip
jsonPath: '$(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.json'
zipPath: '$(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.zip'
Expand Down
Loading