Skip to content

Commit abf1472

Browse files
committed
Publish ia32 last to prevent fallbacks and fix pipeline
1 parent 33ba55d commit abf1472

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

azure-pipelines/release.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,36 +53,37 @@ stages:
5353
$publishArtifacts = $allArtifacts[0]
5454
Write-Host "All artifacts: $($allArtifacts). Publishing $($publishArtifacts)."
5555
56-
$additionalPublishArgs = , "publish"
56+
$basePublishArgs = , "publish"
5757
# Artifacts are published to either pre-release or release based on the build branch, https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions
5858
If ("$(resources.pipeline.officialBuildCI.sourceBranch)" -eq "refs/heads/main") {
59-
$additionalPublishArgs += "--pre-release"
59+
$basePublishArgs += "--pre-release"
6060
Write-Host "Publish to pre-release channel."
6161
} ElseIf ("$(resources.pipeline.officialBuildCI.sourceBranch)" -eq "refs/heads/release") {
6262
Write-Host "Publish to release channel."
6363
} Else {
6464
throw "Unexpected branch name: $(resources.pipeline.officialBuildCI.sourceBranch)."
6565
}
66-
$additionalPublishArgs += '--packagePath'
66+
$basePublishArgs += '--packagePath'
6767
68-
$platforms = "arm64", "x64", "ia32"
69-
$allVsixs = Get-ChildItem $publishArtifacts *.vsix
70-
foreach ($vsix in $allVsixs) {
71-
foreach ($plat in $platforms) {
72-
if ($vsix.Name.Contains($plat)) {
73-
$additionalPublishArgs += $vsix
74-
}
75-
}
76-
}
68+
# Publish win32-ia32 last as recommended at https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions
69+
# Since validation is done asynchronously, we further take care to push the win32 variants in the first batch *first*,
70+
# to give them the longest lead time possible before the second batch with just the win32-ia32 vsix is published.
71+
$nonIA32PlatformArgs = $basePublishArgs + (Get-ChildItem $publishArtifacts\*.vsix -Include *x64*, *arm64* | Sort-Object Name -Descending |% { $_ })
72+
$ia32PlatformArgs = $basePublishArgs + (Get-ChildItem $publishArtifacts\*.vsix -Include *ia32* | Sort-Object Name -Descending |% { $_ })
7773
78-
Write-Host "Command run is: vsce $($additionalPublishArgs)."
79-
If ("${{ parameters.test }}") {
74+
If ("${{ parameters.test }}" -eq "true") {
8075
Write-Host "In test mode, command is printed instead of run."
76+
Write-Host "##[command]vsce $nonIA32PlatformArgs"
77+
Write-Host "##[command]vsce $ia32PlatformArgs"
78+
8179
Write-Host "🔒 Verify PAT."
8280
vsce verify-pat ms-dotnettools
8381
}
8482
Else {
85-
vsce @additionalPublishArgs
83+
Write-Host "##[command]vsce $nonIA32PlatformArgs"
84+
vsce @nonIA32PlatformArgs
85+
Write-Host "##[command]vsce $ia32PlatformArgs"
86+
vsce @ia32PlatformArgs
8687
}
8788
displayName: 🚀 Publish to Marketplace
8889
workingDirectory: $(Pipeline.Workspace)

0 commit comments

Comments
 (0)