Skip to content

Commit 277e805

Browse files
committed
Reduce VSIX release to 1 step and output marketplace info
1 parent 040e4bd commit 277e805

File tree

1 file changed

+30
-24
lines changed

1 file changed

+30
-24
lines changed

eng/pipelines/templates/jobs/vsix/release-vsix.yml

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ jobs:
4040
runOnce:
4141
deploy:
4242
steps:
43-
- pwsh: |
44-
$buildInfoPath = "$(Pipeline.Workspace)/build_info/build_info.json"
45-
$buildInfo = Get-Content $buildInfoPath -Raw | ConvertFrom-Json
46-
$server = $buildInfo.servers | Where-Object { $_.name -eq '${{ parameters.ServerName }}' }
47-
$prereleaseArg = $server.vsixIsPrerelease ? "--pre-release" : ""
48-
Write-Host "Server: $($server.name), Version: $($server.version), VSIX Version: $($server.vsixVersion), Is Prerelease: $($server.vsixIsPrerelease)"
49-
Write-Host "Prerelease argument: '$prereleaseArg'"
50-
Write-Host "##vso[task.setvariable variable=prereleaseArg]$prereleaseArg"
51-
displayName: Determine prerelease flag from build_info
52-
5343
- task: AzureCLI@2
5444
displayName: "Publish (using vsce) - ${{ VsixTarget }}"
5545
inputs:
@@ -59,19 +49,35 @@ jobs:
5949
workingDirectory: $(Pipeline.Workspace)/drop/${{ parameters.ServerName }}/${{ VsixTarget }}
6050
inlineScript: |
6151
Write-Host "Publishing VSIX for ${{ VsixTarget }}"
62-
52+
Write-Host "VS Code Marketplace info for az login:"
53+
az rest -u https://app.vssps.visualstudio.com/_apis/profile/profiles/me --resource 499b84ac-1321-427f-aa17-267ca6975798
54+
55+
$buildInfo = Get-Content "$(Pipeline.Workspace)/build_info/build_info.json" -Raw | ConvertFrom-Json
56+
$server = $buildInfo.servers | Where-Object { $_.name -eq '${{ parameters.ServerName }}' }
57+
6358
$baseName = Get-ChildItem *.vsix | Select-Object -ExpandProperty BaseName -First 1
64-
Write-Host "VSIX baseName: $baseName"
65-
Write-Host "Prerelease argument: '$(prereleaseArg)'"
66-
67-
npm install -g @vscode/vsce
68-
69-
if ("$(prereleaseArg)" -ne "") {
70-
$publishCmd = "vsce publish --azure-credential --packagePath `"$baseName.vsix`" --manifestPath `"$baseName.manifest`" --signaturePath `"$baseName.signature.p7s`" --pre-release"
71-
Write-Host "Executing: $publishCmd"
72-
vsce publish --azure-credential --packagePath "$baseName.vsix" --manifestPath "$baseName.manifest" --signaturePath "$baseName.signature.p7s" --pre-release
73-
} else {
74-
$publishCmd = "vsce publish --azure-credential --packagePath `"$baseName.vsix`" --manifestPath `"$baseName.manifest`" --signaturePath `"$baseName.signature.p7s`""
75-
Write-Host "Executing: $publishCmd"
76-
vsce publish --azure-credential --packagePath "$baseName.vsix" --manifestPath "$baseName.manifest" --signaturePath "$baseName.signature.p7s"
59+
60+
$args = @('--azure-credential', "--packagePath `"$baseName.vsix`"", "--manifestPath `"$baseName.manifest`"", "--signaturePath `"$baseName.signature.p7s`"")
61+
if ($server.vsixIsPrerelease) {
62+
$args += '--pre-release'
7763
}
64+
65+
$publishCmd = "vsce publish $($args -join ' ')"
66+
67+
Write-Host @"
68+
Server: $($server.name)
69+
Version: $($server.version)
70+
VSIX Version: $($server.vsixVersion)
71+
VSIX baseName: $baseName
72+
Is Prerelease: $($server.vsixIsPrerelease)
73+
74+
Publish arguments:
75+
$($args -join '`n ')
76+
"@
77+
78+
Write-Host ''
79+
Write-Host 'Installing vsce...'
80+
npm install -g @vscode/vsce
81+
82+
Write-Host "Executing: $publishCmd"
83+
Invoke-Expression $publishCmd

0 commit comments

Comments
 (0)