@@ -155,7 +155,7 @@ function Update-Branch {
155
155
156
156
<#
157
157
. SYNOPSIS
158
- Gets current version from changelog as [semver].
158
+ Gets current version from changelog as ` [semver]` .
159
159
#>
160
160
function Get-Version {
161
161
param (
@@ -177,7 +177,7 @@ function Get-Version {
177
177
Updates the CHANGELOG file with PRs merged since the last release.
178
178
. DESCRIPTION
179
179
Uses the local Git repositories but does not pull, so ensure HEAD is where
180
- you want it. Creates a new branch at ' release/$Version' if not already
180
+ you want it. Creates a new branch at ` release/$Version` if not already
181
181
checked out. Handles any merge option for PRs, but is a little slow as it
182
182
queries all PRs.
183
183
#>
@@ -428,3 +428,42 @@ function New-DraftRelease {
428
428
$Assets | New-GitHubReleaseAsset - Release $Release.Id
429
429
}
430
430
}
431
+
432
+ <#
433
+ . SYNOPSIS
434
+ Uploads VSIX and PS1 binaries to their respective marketplaces.
435
+ . DESCRIPTION
436
+ The VSIX is uploaded to the Visual Studio Code Marketplace using the `vsce`
437
+ tool and the `VsceToken` parameter:
438
+ https://marketplace.visualstudio.com/VSCode
439
+
440
+ The PS1 is uploaded to the PowerShell Gallery using the `Publish-Script`
441
+ cmdlet and the `GalleryToken` parameter: https://www.powershellgallery.com
442
+
443
+ This function is primarily used by ADO pipelines, but could be used manually.
444
+ #>
445
+ function Publish-Assets {
446
+ param (
447
+ [Parameter (Mandatory )]
448
+ [string []]$Assets ,
449
+
450
+ [Parameter ()]
451
+ [string ]$VsceToken ,
452
+
453
+ [Parameter ()]
454
+ [string ]$GalleryToken
455
+ )
456
+ switch ($Assets ) {
457
+ { $_.EndsWith (" .vsix" ) } {
458
+ Write-Host " Uploading VSIX..."
459
+ vsce publish -- packagePath $_ -- pat $VsceToken
460
+ }
461
+ { $_.EndsWith (" .ps1" ) } {
462
+ Write-Host " Uploading PS1..."
463
+ Publish-Script - Path $_ - NuGetApiKey $GalleryToken
464
+ }
465
+ default {
466
+ Write-Error " Unsupported file: $_ "
467
+ }
468
+ }
469
+ }
0 commit comments