Skip to content
Merged
22 changes: 20 additions & 2 deletions .pipelines/templates/package-create-msix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,31 @@ jobs:

Write-Host "##vso[task.setvariable variable=ServiceConnection]$($config.ServiceEndpoint)"
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: 'StoreAppPublish-Private'
serviceEndpoint: 'StoreAppPublish-Stable'
sbConfigPath: '$(SBConfigPath)'
sourceFolder: '$(BundleDir)'
contents: '*.msixBundle'
Expand Down
52 changes: 23 additions & 29 deletions .pipelines/templates/release-MSIX-Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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 @@ -73,25 +73,37 @@ jobs:

Write-Verbose -Verbose "Channel Selection - LTS: $(LTS), Stable: $(STABLE), Preview: $(PREVIEW)"

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


# 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 "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 LTS StoreBroker Package'
condition: and(ne('${{ parameters.skipMSIXPublish }}', 'true'), eq(variables['LTS'], 'true'))
displayName: 'Publish StoreBroker Package (Stable/LTS)'
condition: and(ne('${{ parameters.skipMSIXPublish }}', 'true'), or(eq('$(STABLE)', 'true'), eq('$(LTS)', 'true')))
inputs:
serviceEndpoint: 'StoreAppPublish-Private'
appId: '$(AppID-LTS)'
serviceEndpoint: 'StoreAppPublish-Stable'
appId: '$(AppID)'
inputMethod: JsonAndZip
jsonPath: '$(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.json'
zipPath: '$(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.zip'
Expand All @@ -100,32 +112,14 @@ jobs:
targetPublishMode: 'Immediate'

- task: MS-RDX-MRO.windows-store-publish.publish-task.store-publish@3
displayName: 'Publish Stable StoreBroker Package'
condition: and(ne('${{ parameters.skipMSIXPublish }}', 'true'), eq(variables['STABLE'], 'true'))
displayName: 'Publish StoreBroker Package (Preview)'
condition: and(ne('${{ parameters.skipMSIXPublish }}', 'true'), eq('$(PREVIEW)', 'true'))
inputs:
serviceEndpoint: 'StoreAppPublish-Private'
appId: '$(AppID-Stable)'
serviceEndpoint: 'StoreAppPublish-Preview'
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 Preview StoreBroker Package'
condition: and(ne('${{ parameters.skipMSIXPublish }}', 'true'), eq(variables['PREVIEW'], 'true'))
inputs:
serviceEndpoint: 'StoreAppPublish-Private'
appId: '$(AppID-Preview)'
inputMethod: JsonAndZip
jsonPath: '$(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.json'
zipPath: '$(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.zip'
numberOfPackagesToKeep: 2
jsonZipUpdateMetadata: true
targetPublishMode: 'Immediate'

- pwsh: |
Get-Content -Path "$(System.DefaultWorkingDirectory)/SBLog.txt" -ErrorAction SilentlyContinue
displayName: Upload Store Failure Log
condition: failed()