@@ -15,12 +15,15 @@ jobs:
1515 artifactName : drop_msixbundle_CreateMSIXBundle
1616 variables :
1717 - group : ' Store Publish Variables'
18+ - name : LTS
19+ value : $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsLTS'] ]
20+ - name : STABLE
21+ value : $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsStable'] ]
22+ - name : PREVIEW
23+ value : $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsPreview'] ]
1824 - template : ./variable/release-shared.yml@self
1925 parameters :
2026 RELEASETAG : $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['OutputReleaseTag.releaseTag'] ]
21- LTS : $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsLTS'] ]
22- STABLE : $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsStable'] ]
23- PREVIEW : $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsPreview'] ]
2427 steps :
2528 - task : PowerShell@2
2629 inputs :
@@ -40,14 +43,14 @@ jobs:
4043 }
4144 $middleURL = ''
4245 $tagString = "$(ReleaseTag)"
43- if ($tagString -match '-') {
46+ if ($tagString -match '-preview ') {
4447 $middleURL = "preview"
4548 }
4649 elseif ($tagString -match '(\d+\.\d+)') {
4750 $middleURL = $matches[1]
4851 }
4952
50- $endURL = $tagString -replace '[v\.]', ''
53+ $endURL = $tagString -replace '^v|\.', ''
5154 $message = "Changelog: https://github.com/PowerShell/PowerShell/blob/master/CHANGELOG/$middleURL.md#$endURL"
5255 Write-Verbose -Verbose "Release Notes for the Store:"
5356 Write-Verbose -Verbose "$message"
@@ -63,25 +66,14 @@ jobs:
6366 inputs :
6467 targetType : inline
6568 script : |
66- Write-Verbose -Verbose "Channel Selection - LTS: $(LTS), Stable: $(Stable), Preview: $(Preview)"
69+ # Convert ADO variables to PowerShell boolean variables
70+ $IsLTS = '$(LTS)' -eq 'true'
71+ $IsStable = '$(STABLE)' -eq 'true'
72+ $IsPreview = '$(PREVIEW)' -eq 'true'
6773
68- # Define app configurations for each channel using secret variables
69- $channelConfigs = @{
70- 'LTS' = @{
71- AppId = '$(AppID-LTS)'
72- ServiceEndpoint = 'StoreAppPublish-Stable'
73- }
74- 'Stable' = @{
75- AppId = '$(AppID-Stable)'
76- ServiceEndpoint = 'StoreAppPublish-Stable'
77- }
78- 'Preview' = @{
79- AppId = '$(AppID-Preview)'
80- ServiceEndpoint = 'StoreAppPublish-Preview'
81- }
82- }
74+ Write-Verbose -Verbose "Channel Selection - LTS: $(LTS), Stable: $(STABLE), Preview: $(PREVIEW)"
8375
84- # Determine the current channel
76+ # Determine the current channel for logging purposes
8577 $currentChannel = if ($IsLTS) { 'LTS' }
8678 elseif ($IsStable) { 'Stable' }
8779 elseif ($IsPreview) { 'Preview' }
@@ -90,26 +82,50 @@ jobs:
9082 exit 1
9183 }
9284
93- $config = $channelConfigs[$currentChannel]
9485 Write-Verbose -Verbose "Selected channel: $currentChannel"
95- Write-Verbose -Verbose "App ID: $($config.AppId)"
96- Write-Verbose -Verbose "Service Endpoint: $($config.ServiceEndpoint)"
97-
98- # Set pipeline variables for use in the store-publish task
99- Write-Host "##vso[task.setvariable variable=SelectedAppId]$($config.AppId)"
100- Write-Host "##vso[task.setvariable variable=SelectedServiceEndpoint]$($config.ServiceEndpoint)"
101- Write-Host "##vso[task.setvariable variable=SelectedChannel]$currentChannel"
102- displayName : ' Set StoreBroker Configurations'
86+ Write-Verbose -Verbose "Conditional tasks will handle the publishing based on channel variables"
87+ displayName : ' Validate Channel Selection'
10388
10489 - task : MS-RDX-MRO.windows-store-publish.publish-task.store-publish@3
10590 displayName : ' Publish LTS StoreBroker Package'
106- condition : ne('${{ parameters.skipMSIXPublish }}', 'true')
91+ condition : and( ne('${{ parameters.skipMSIXPublish }}', 'true'), eq(variables['LTS'], 'true') )
10792 inputs :
108- serviceEndpoint : ' $(SelectedServiceEndpoint) '
109- appId : ' $(SelectedAppId )'
93+ serviceEndpoint : ' StoreAppPublish-Private '
94+ appId : ' $(AppID-LTS )'
11095 inputMethod : JsonAndZip
11196 jsonPath : ' $(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.json'
11297 zipPath : ' $(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.zip'
11398 numberOfPackagesToKeep : 2
11499 jsonZipUpdateMetadata : true
115100 targetPublishMode : ' Immediate'
101+
102+ - task : MS-RDX-MRO.windows-store-publish.publish-task.store-publish@3
103+ displayName : ' Publish Stable StoreBroker Package'
104+ condition : and(ne('${{ parameters.skipMSIXPublish }}', 'true'), eq(variables['STABLE'], 'true'))
105+ inputs :
106+ serviceEndpoint : ' StoreAppPublish-Private'
107+ appId : ' $(AppID-Stable)'
108+ inputMethod : JsonAndZip
109+ jsonPath : ' $(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.json'
110+ zipPath : ' $(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.zip'
111+ numberOfPackagesToKeep : 2
112+ jsonZipUpdateMetadata : true
113+ targetPublishMode : ' Immediate'
114+
115+ - task : MS-RDX-MRO.windows-store-publish.publish-task.store-publish@3
116+ displayName : ' Publish Preview StoreBroker Package'
117+ condition : and(ne('${{ parameters.skipMSIXPublish }}', 'true'), eq(variables['PREVIEW'], 'true'))
118+ inputs :
119+ serviceEndpoint : ' StoreAppPublish-Private'
120+ appId : ' $(AppID-Preview)'
121+ inputMethod : JsonAndZip
122+ jsonPath : ' $(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.json'
123+ zipPath : ' $(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.zip'
124+ numberOfPackagesToKeep : 2
125+ jsonZipUpdateMetadata : true
126+ targetPublishMode : ' Immediate'
127+
128+ - pwsh : |
129+ Get-Content -Path "$(System.DefaultWorkingDirectory)/SBLog.txt" -ErrorAction SilentlyContinue
130+ displayName: Upload Store Failure Log
131+ condition: failed()
0 commit comments