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
8 changes: 5 additions & 3 deletions .pipelines/PowerShell-Release-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ extends:
parameters:
jobName: "LinuxSDK"
displayName: "Linux SDK Validation"
imageName: PSMMSUbuntu20.04-Secure
imageName: PSMMSUbuntu22.04-Secure
poolName: $(ubuntuPool)

- stage: gbltool
Expand Down Expand Up @@ -365,10 +365,12 @@ extends:
This is typically done by the community 1-2 days after the release.

- stage: PublishMsix
dependsOn: PushGitTagAndMakeDraftPublic
dependsOn:
- setReleaseTagAndChangelog
- PushGitTagAndMakeDraftPublic
displayName: Publish MSIX to store
variables:
ob_release_environment: Production
ob_release_environment: ${{ variables.releaseEnvironment }}
jobs:
- template: /.pipelines/templates/release-MSIX-Publish.yml@self
parameters:
Expand Down
6 changes: 4 additions & 2 deletions .pipelines/store/SBConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"packageParameters": {
"PDPRootPath": "",
"Release": "",
"PDPInclude": [],
"PDPInclude": [
"PDP.xml"
],
"PDPExclude": [],
"LanguageExclude": [
"default",
Expand All @@ -21,7 +23,7 @@
},
"appSubmission": {
"productId": "",
"targetPublishMode": "NotSet",
"targetPublishMode": "Immediate",
"targetPublishDate": null,
"visibility": "NotSet",
"pricing": {
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/templates/channelSelection.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- pwsh: |
# Determine LTS, Preview, or Stable
$metadata = Get-Content "$repoRoot/tools/metadata.json" -Raw | ConvertFrom-Json
$metadata = Get-Content "$(Build.SourcesDirectory)/PowerShell/tools/metadata.json" -Raw | ConvertFrom-Json
$LTS = $metadata.LTSRelease.Latest
$Stable = $metadata.StableRelease.Latest
$isPreview = '$(OutputReleaseTag.releaseTag)' -match '-'
Expand Down
31 changes: 25 additions & 6 deletions .pipelines/templates/package-create-msix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ jobs:
- group: msixTools
- group: 'Azure Blob variable group'
- group: 'Store Publish Variables'
- name: ob_sdl_credscan_suppressionsFile
value: $(Build.SourcesDirectory)\PowerShell\.config\suppress.json
- name: ob_sdl_tsa_configFile
value: $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'

Expand Down Expand Up @@ -137,16 +141,19 @@ jobs:
'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"
}
}
Expand All @@ -171,16 +178,21 @@ jobs:

[xml]$pdpXml = Get-Content $pdpPath -Raw

$appStoreNameElement = $pdpXml.SelectSingleNode("//AppStoreName[@_locID]")
# 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.InnerText = $config.AppStoreName
Write-Verbose -Verbose "Updated AppStoreName to: $($config.AppStoreName)"
$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
Expand All @@ -198,27 +210,34 @@ jobs:

$sbConfigJson | ConvertTo-Json -Depth 100 | Set-Content $sbConfigPath -Encoding UTF8
Write-Verbose -Verbose "SBConfig file updated successfully"
Get-Content -Path $sbConfigPath | Write-Verbose -Verbose
} else {
Write-Error "SBConfig file not found: $sbConfigPath"
exit 1
}

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)"
name: UpdateConfigs
displayName: Update PDPs and SBConfig.json

- task: MS-RDX-MRO.windows-store-publish-dev.package-task.store-package@3
- task: MS-RDX-MRO.windows-store-publish.package-task.store-package@3
displayName: 'Create StoreBroker Package'
inputs:
serviceEndpoint: '$(ServiceConnection)'
serviceEndpoint: 'StoreAppPublish-Private'
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'

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

- pwsh: |
$submissionPackageDir = "$(System.DefaultWorkingDirectory)/SBOutDir"
$jsonFile = "$submissionPackageDir/PowerShellStorePackage.json"
Expand Down
84 changes: 50 additions & 34 deletions .pipelines/templates/release-MSIX-Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ jobs:
artifactName: drop_msixbundle_CreateMSIXBundle
variables:
- group: 'Store Publish Variables'
- name: LTS
value: $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsLTS'] ]
- name: STABLE
value: $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsStable'] ]
- name: PREVIEW
value: $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsPreview'] ]
- template: ./variable/release-shared.yml@self
parameters:
RELEASETAG: $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['OutputReleaseTag.releaseTag'] ]
LTS: $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsLTS'] ]
STABLE: $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsStable'] ]
PREVIEW: $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['ChannelSelection.IsPreview'] ]
steps:
- task: PowerShell@2
inputs:
Expand All @@ -40,14 +43,14 @@ jobs:
}
$middleURL = ''
$tagString = "$(ReleaseTag)"
if ($tagString -match '-') {
if ($tagString -match '-preview') {
$middleURL = "preview"
}
elseif ($tagString -match '(\d+\.\d+)') {
$middleURL = $matches[1]
}

$endURL = $tagString -replace '[v\.]',''
$endURL = $tagString -replace '^v|\.', ''
$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,25 +66,14 @@ jobs:
inputs:
targetType: inline
script: |
Write-Verbose -Verbose "Channel Selection - LTS: $(LTS), Stable: $(Stable), Preview: $(Preview)"
# Convert ADO variables to PowerShell boolean variables
$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
# Determine the current channel for logging purposes
$currentChannel = if ($IsLTS) { 'LTS' }
elseif ($IsStable) { 'Stable' }
elseif ($IsPreview) { 'Preview' }
Expand All @@ -90,26 +82,50 @@ jobs:
exit 1
}

$config = $channelConfigs[$currentChannel]
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 LTS StoreBroker Package'
condition: ne('${{ parameters.skipMSIXPublish }}', 'true')
condition: and(ne('${{ parameters.skipMSIXPublish }}', 'true'), eq(variables['LTS'], 'true'))
inputs:
serviceEndpoint: '$(SelectedServiceEndpoint)'
appId: '$(SelectedAppId)'
serviceEndpoint: 'StoreAppPublish-Private'
appId: '$(AppID-LTS)'
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 Stable StoreBroker Package'
condition: and(ne('${{ parameters.skipMSIXPublish }}', 'true'), eq(variables['STABLE'], 'true'))
inputs:
serviceEndpoint: 'StoreAppPublish-Private'
appId: '$(AppID-Stable)'
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()
4 changes: 2 additions & 2 deletions .pipelines/templates/release-githubNuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ jobs:
$middleURL = ''
$tagString = "$(ReleaseTag)"
Write-Verbose -Verbose "Use the following command to push the tag:"
if ($tagString -match '-') {
if ($tagString -match '-preview') {
$middleURL = "preview"
}
elseif ($tagString -match '(\d+\.\d+)') {
$middleURL = $matches[1]
}
$endURL = $tagString -replace '[v\.]',''
$endURL = $tagString -replace '^v|\.', ''
$message = "https://github.com/PowerShell/PowerShell/blob/master/CHANGELOG/$middleURL.md#$endURL"
Write-Verbose -Verbose "git tag -a $(ReleaseTag) $env:BUILD_SOURCEVERSION -m $message"
displayName: Git Push Tag Command
Expand Down
6 changes: 6 additions & 0 deletions .pipelines/templates/release-validate-globaltools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
- pwsh: |
$repoRoot = "$(Build.SourcesDirectory)/PowerShell"

Import-Module "$repoRoot/build.psm1" -Force -Verbose
Start-PSBootstrap -Scenario Dotnet

$toolPath = New-Item -ItemType Directory "$(System.DefaultWorkingDirectory)/toolPath" | Select-Object -ExpandProperty FullName

Write-Verbose -Verbose "dotnet tool list -g"
Expand Down Expand Up @@ -75,6 +78,9 @@ jobs:
- pwsh: |
$repoRoot = "$(Build.SourcesDirectory)/PowerShell"

Import-Module "$repoRoot/build.psm1" -Force -Verbose
Start-PSBootstrap -Scenario Dotnet

$exeName = if ($IsWindows) { "pwsh.exe" } else { "pwsh" }

$toolPath = "$(System.DefaultWorkingDirectory)/toolPath/${{ parameters.globalToolExeName }}"
Expand Down
3 changes: 3 additions & 0 deletions .pipelines/templates/release-validate-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ jobs:
- pwsh: |
$repoRoot = "$(Build.SourcesDirectory)"

Import-Module "$repoRoot/build.psm1" -Force -Verbose
Start-PSBootstrap -Scenario Dotnet

$env:DOTNET_NOLOGO=1

$localLocation = "$(Pipeline.Workspace)/PSPackagesOfficial/drop_nupkg_build_nupkg"
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/templates/windows-hosted-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ jobs:
'Microsoft.PowerShell.PSResourceGet'
'Microsoft.PowerShell.Archive'
'PSReadLine'
'ThreadJob'
'Microsoft.PowerShell.ThreadJob'
)

$sourceModulePath = Join-Path '$(GlobalToolArtifactPath)' 'publish' 'PowerShell.Windows.x64' 'release' 'Modules'
Expand Down
Loading