diff --git a/.pipelines/store/PDP/PDP/en-US/PDP.xml b/.pipelines/store/PDP/PDP/en-US/PDP.xml index ce36a3677..552009ec2 100644 --- a/.pipelines/store/PDP/PDP/en-US/PDP.xml +++ b/.pipelines/store/PDP/PDP/en-US/PDP.xml @@ -1,12 +1,5 @@ - - - - - - - @@ -51,23 +44,9 @@ PowerShell is Open Source. See https://github.com/powershell/powershell - Please see our GitHub releases page for additional details. - - - - - - - - - - - - - - - - + Version: ___VERSION___ + +Changelog: ___CHANGELOGLINK___ diff --git a/.pipelines/store/SBConfig.json b/.pipelines/store/SBConfig.json index a52d60b04..e6c8d5437 100644 --- a/.pipelines/store/SBConfig.json +++ b/.pipelines/store/SBConfig.json @@ -14,8 +14,6 @@ "qps-ploca", "qps-plocm" ], - "MediaRootPath": "", - "MediaFallbackLanguage": "en-US", "PackagePath": [], "OutPath": "", "OutName": "", diff --git a/.pipelines/templates/package-store-package.yml b/.pipelines/templates/package-store-package.yml index 4ee209833..3be223987 100644 --- a/.pipelines/templates/package-store-package.yml +++ b/.pipelines/templates/package-store-package.yml @@ -57,19 +57,16 @@ jobs: # Define app configurations for each channel $channelConfigs = @{ 'LTS' = @{ - AppStoreName = 'PowerShell-LTS' ProductId = '$(productId-LTS)' AppId = '$(AppID-LTS)' ServiceEndpoint = "StoreAppPublish-Stable" } 'Stable' = @{ - AppStoreName = 'PowerShell' ProductId = '$(productId-Stable)' AppId = '$(AppID-Stable)' ServiceEndpoint = "StoreAppPublish-Stable" } 'Preview' = @{ - AppStoreName = 'PowerShell (Preview)' ProductId = '$(productId-Preview)' AppId = '$(AppID-Preview)' ServiceEndpoint = "StoreAppPublish-Preview" @@ -100,36 +97,8 @@ jobs: $config = $channelConfigs[$currentChannel] Write-Verbose -Verbose "Selected channel: $currentChannel" - Write-Verbose -Verbose "App Store Name: $($config.AppStoreName)" Write-Verbose -Verbose "Product ID: $($config.ProductId)" - # Update PDP.xml file - $pdpPath = '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/PDP/PDP/en-US/PDP.xml' - if (Test-Path $pdpPath) { - Write-Verbose -Verbose "Updating PDP file: $pdpPath" - - [xml]$pdpXml = Get-Content $pdpPath -Raw - - # Create namespace manager for XML with default namespace - $nsManager = New-Object System.Xml.XmlNamespaceManager($pdpXml.NameTable) - $nsManager.AddNamespace("pd", "http://schemas.microsoft.com/appx/2012/ProductDescription") - - $appStoreNameElement = $pdpXml.SelectSingleNode("//pd:AppStoreName", $nsManager) - if ($appStoreNameElement) { - $appStoreNameElement.SetAttribute("_locID", $config.AppStoreName) - Write-Verbose -Verbose "Updated AppStoreName _locID to: $($config.AppStoreName)" - } else { - Write-Warning "AppStoreName element not found in PDP file" - } - - $pdpXml.Save($pdpPath) - Write-Verbose -Verbose "PDP file updated successfully" - Get-Content -Path $pdpPath | Write-Verbose -Verbose - } else { - Write-Error "PDP file not found: $pdpPath" - exit 1 - } - # Update SBConfig.json file $sbConfigPath = '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/SBConfig.json' if (Test-Path $sbConfigPath) { @@ -190,7 +159,7 @@ jobs: Write-Verbose -Verbose "Variables set successfully" name: UpdateConfigs - displayName: Update PDPs and SBConfig.json + displayName: Update SBConfig.json and Store Variables - pwsh: | Write-Verbose -Verbose "Checking variables after UpdateConfigs:" @@ -209,7 +178,8 @@ jobs: contents: '*.msixBundle' outSBName: 'PowerShellStorePackage' pdpPath: '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/PDP/PDP' - pdpMediaPath: '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/PDP/PDP-Media' + # StoreBroker v3 requires a media root with a PDP root, even when the PDP has no media. + pdpMediaPath: '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/PDP/PDP' - task: MS-RDX-MRO.windows-store-publish.package-task.store-package@3 displayName: 'Create StoreBroker Package (Stable/LTS)' @@ -221,7 +191,8 @@ jobs: contents: '*.msixBundle' outSBName: 'PowerShellStorePackage' pdpPath: '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/PDP/PDP' - pdpMediaPath: '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/PDP/PDP-Media' + # StoreBroker v3 requires a media root with a PDP root, even when the PDP has no media. + pdpMediaPath: '$(System.DefaultWorkingDirectory)/PowerShell/.pipelines/store/PDP/PDP' - pwsh: | $outputDirectory = "$(ob_outputDirectory)" diff --git a/.pipelines/templates/release-MSIX-Publish.yml b/.pipelines/templates/release-MSIX-Publish.yml index a68755725..14ad3d7be 100644 --- a/.pipelines/templates/release-MSIX-Publish.yml +++ b/.pipelines/templates/release-MSIX-Publish.yml @@ -52,23 +52,42 @@ jobs: } $endURL = $tagString -replace '^v','' -replace '\.','' - $message = "Changelog: https://github.com/PowerShell/PowerShell/blob/master/CHANGELOG/$middleURL.md#$endURL" + $changelogLink = "https://github.com/PowerShell/PowerShell/blob/master/CHANGELOG/$middleURL.md#$endURL" Write-Verbose -Verbose "Release Notes for the Store:" - Write-Verbose -Verbose "$message" $jsonPath = "$(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.json" $json = Get-Content $jsonPath -Raw | ConvertFrom-Json - $json.listings.'en-us'.baseListing.releaseNotes = $message + $releaseNoteVariables = @{ + '___VERSION___' = $tagString + '___CHANGELOGLINK___' = $changelogLink + } - # Add PowerShell version to the top of the description - $description = $json.listings.'en-us'.baseListing.description - $version = "$(ReleaseTag)" - $updatedDescription = "Version: $version`n`n$description" - $json.listings.'en-us'.baseListing.description = $updatedDescription - Write-Verbose -Verbose "Updated description: $updatedDescription" + $listingProperties = @($json.listings.PSObject.Properties) + if ($listingProperties.Count -eq 0) { + throw "Store listings are missing from '$jsonPath'." + } + + foreach ($listingProperty in $listingProperties) { + $language = $listingProperty.Name + $releaseNotes = $listingProperty.Value.baseListing.releaseNotes + if ([string]::IsNullOrWhiteSpace($releaseNotes)) { + throw "Store release notes for '$language' are missing from '$jsonPath'." + } + + foreach ($placeholder in $releaseNoteVariables.Keys) { + if (-not $releaseNotes.Contains($placeholder)) { + throw "Store release notes for '$language' do not contain the required placeholder '$placeholder'." + } + $releaseNotes = $releaseNotes.Replace($placeholder, $releaseNoteVariables[$placeholder]) + } + + $listingProperty.Value.baseListing.releaseNotes = $releaseNotes + Write-Verbose -Verbose "Release notes for '$language':" + Write-Verbose -Verbose $releaseNotes + } $json | ConvertTo-Json -Depth 100 | Set-Content $jsonPath -Encoding UTF8 - displayName: 'Add Changelog Link and Version Number to SBJSON' + displayName: 'Set Store Release Note Variables' - task: PowerShell@2 condition: or(eq(variables['LTS'], 'true'), eq(variables['STABLE'], 'true'), eq(variables['PREVIEW'], 'true')) diff --git a/assets/AppxManifest.xml b/assets/AppxManifest.xml index dfcd95935..e5b26a892 100644 --- a/assets/AppxManifest.xml +++ b/assets/AppxManifest.xml @@ -24,7 +24,7 @@ - +