Skip to content

Commit 873db35

Browse files
daxian-dbwjshigetomi
authored andcommitted
Use StoreAppPublish-Preview explicitly
Use BuildSources.Directory instead of reporoot Add powershell use sbConfigPath Add variable group store publish variables Use spaces in name Change the AppStoreName locID Output the PDP and config file Temporarily disable signing Use AppStore Xpath Use namespace xml Use AppID Upload SBLog.txt on failure Try powershell private Remove AppID addition
1 parent d6cca3f commit 873db35

File tree

3 files changed

+32
-15
lines changed

3 files changed

+32
-15
lines changed

.pipelines/store/SBConfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"packageParameters": {
55
"PDPRootPath": "",
66
"Release": "",
7-
"PDPInclude": [],
7+
"PDPInclude": [
8+
"PDP.xml"
9+
],
810
"PDPExclude": [],
911
"LanguageExclude": [
1012
"default",
@@ -21,7 +23,7 @@
2123
},
2224
"appSubmission": {
2325
"productId": "",
24-
"targetPublishMode": "NotSet",
26+
"targetPublishMode": "Immediate",
2527
"targetPublishDate": null,
2628
"visibility": "NotSet",
2729
"pricing": {

.pipelines/templates/channelSelection.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
steps:
22
- pwsh: |
33
# Determine LTS, Preview, or Stable
4-
$metadata = Get-Content "$repoRoot/tools/metadata.json" -Raw | ConvertFrom-Json
4+
$metadata = Get-Content "$(Build.SourcesDirectory)/PowerShell/tools/metadata.json" -Raw | ConvertFrom-Json
55
$LTS = $metadata.LTSRelease.Latest
66
$Stable = $metadata.StableRelease.Latest
77
$isPreview = '$(OutputReleaseTag.releaseTag)' -match '-'

.pipelines/templates/package-create-msix.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ jobs:
9393
displayName: Create MsixBundle
9494
retryCountOnTaskFailure: 1
9595
96-
- task: onebranch.pipeline.signing@1
97-
displayName: Sign MsixBundle
98-
inputs:
99-
command: 'sign'
100-
signing_profile: $(MSIXProfile)
101-
files_to_sign: '**/*.msixbundle'
102-
search_root: '$(BundleDir)'
96+
# - task: onebranch.pipeline.signing@1
97+
# displayName: Sign MsixBundle
98+
# inputs:
99+
# command: 'sign'
100+
# signing_profile: $(MSIXProfile)
101+
# files_to_sign: '**/*.msixbundle'
102+
# search_root: '$(BundleDir)'
103103

104104
- pwsh: |
105105
$signedBundle = Get-ChildItem -Path $(BundleDir) -Filter "*.msixbundle" -File
@@ -137,16 +137,19 @@ jobs:
137137
'LTS' = @{
138138
AppStoreName = 'PowerShell-LTS'
139139
ProductId = '$(productId-LTS)'
140+
AppId = '$(AppID-LTS)'
140141
ServiceEndpoint = "StoreAppPublish-Stable"
141142
}
142143
'Stable' = @{
143144
AppStoreName = 'PowerShell'
144145
ProductId = '$(productId-Stable)'
146+
AppId = '$(AppID-Stable)'
145147
ServiceEndpoint = "StoreAppPublish-Stable"
146148
}
147149
'Preview' = @{
148150
AppStoreName = 'PowerShell (Preview)'
149151
ProductId = '$(productId-Preview)'
152+
AppId = '$(AppID-Preview)'
150153
ServiceEndpoint = "StoreAppPublish-Preview"
151154
}
152155
}
@@ -171,16 +174,21 @@ jobs:
171174
172175
[xml]$pdpXml = Get-Content $pdpPath -Raw
173176
174-
$appStoreNameElement = $pdpXml.SelectSingleNode("//AppStoreName[@_locID]")
177+
# Create namespace manager for XML with default namespace
178+
$nsManager = New-Object System.Xml.XmlNamespaceManager($pdpXml.NameTable)
179+
$nsManager.AddNamespace("pd", "http://schemas.microsoft.com/appx/2012/ProductDescription")
180+
181+
$appStoreNameElement = $pdpXml.SelectSingleNode("//pd:AppStoreName", $nsManager)
175182
if ($appStoreNameElement) {
176-
$appStoreNameElement.InnerText = $config.AppStoreName
177-
Write-Verbose -Verbose "Updated AppStoreName to: $($config.AppStoreName)"
183+
$appStoreNameElement.SetAttribute("_locID", $config.AppStoreName)
184+
Write-Verbose -Verbose "Updated AppStoreName _locID to: $($config.AppStoreName)"
178185
} else {
179186
Write-Warning "AppStoreName element not found in PDP file"
180187
}
181188
182189
$pdpXml.Save($pdpPath)
183190
Write-Verbose -Verbose "PDP file updated successfully"
191+
Get-Content -Path $pdpPath | Write-Verbose -Verbose
184192
} else {
185193
Write-Error "PDP file not found: $pdpPath"
186194
exit 1
@@ -198,27 +206,34 @@ jobs:
198206
199207
$sbConfigJson | ConvertTo-Json -Depth 100 | Set-Content $sbConfigPath -Encoding UTF8
200208
Write-Verbose -Verbose "SBConfig file updated successfully"
209+
Get-Content -Path $sbConfigPath | Write-Verbose -Verbose
201210
} else {
202211
Write-Error "SBConfig file not found: $sbConfigPath"
203212
exit 1
204213
}
205214
206215
Write-Host "##vso[task.setvariable variable=ServiceConnection]$($config.ServiceEndpoint)"
207-
Write-Host "##vso[task.setvariable variable=SBConfigPath]$($config.SBConfigPath)"
216+
Write-Host "##vso[task.setvariable variable=SBConfigPath]$($sbConfigPath)"
208217
name: UpdateConfigs
209218
displayName: Update PDPs and SBConfig.json
210219
211220
- task: MS-RDX-MRO.windows-store-publish.package-task.store-package@3
212221
displayName: 'Create StoreBroker Package'
213222
inputs:
214-
serviceEndpoint: '$(ServiceConnection)'
223+
serviceEndpoint: 'StoreAppPublish-Private'
215224
sbConfigPath: '$(SBConfigPath)'
216225
sourceFolder: '$(BundleDir)'
217226
contents: '*.msixBundle'
218227
outSBName: 'PowerShellStorePackage'
219228
pdpPath: '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/PDP/PDP'
220229
pdpMediaPath: '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/PDP/PDP-Media'
221230

231+
- pwsh: |
232+
Get-Item -Path "$(System.DefaultWorkingDirectory)/SBLog.txt" -ErrorAction SilentlyContinue |
233+
Copy-Item -Destination "$(ob_outputDirectory)" -Verbose
234+
displayName: Upload Store Failure Log
235+
condition: failed()
236+
222237
- pwsh: |
223238
$submissionPackageDir = "$(System.DefaultWorkingDirectory)/SBOutDir"
224239
$jsonFile = "$submissionPackageDir/PowerShellStorePackage.json"

0 commit comments

Comments
 (0)