@@ -151,7 +151,7 @@ function Update-Branch {
151
151
152
152
<#
153
153
. SYNOPSIS
154
- Gets current version from changelog as [semver].
154
+ Gets current version from changelog as ` [semver]` .
155
155
#>
156
156
function Get-Version {
157
157
param (
@@ -173,7 +173,7 @@ function Get-Version {
173
173
Updates the CHANGELOG file with PRs merged since the last release.
174
174
. DESCRIPTION
175
175
Uses the local Git repositories but does not pull, so ensure HEAD is where
176
- you want it. Creates a new branch at ' release/$Version' if not already
176
+ you want it. Creates a new branch at ` release/$Version` if not already
177
177
checked out. Handles any merge option for PRs, but is a little slow as it
178
178
queries all PRs.
179
179
#>
@@ -366,3 +366,42 @@ function New-DraftRelease {
366
366
Write-Output " Uploading assets..."
367
367
$Assets | New-GitHubReleaseAsset - Release $Release.Id
368
368
}
369
+
370
+ <#
371
+ . SYNOPSIS
372
+ Uploads VSIX and PS1 binaries to their respective marketplaces.
373
+ . DESCRIPTION
374
+ The VSIX is uploaded to the Visual Studio Code Marketplace using the `vsce`
375
+ tool and the `VsceToken` parameter:
376
+ https://marketplace.visualstudio.com/VSCode
377
+
378
+ The PS1 is uploaded to the PowerShell Gallery using the `Publish-Script`
379
+ cmdlet and the `GalleryToken` parameter: https://www.powershellgallery.com
380
+
381
+ This function is primarily used by ADO pipelines, but could be used manually.
382
+ #>
383
+ function Publish-Assets {
384
+ param (
385
+ [Parameter (Mandatory )]
386
+ [string []]$Assets ,
387
+
388
+ [Parameter ()]
389
+ [string ]$VsceToken ,
390
+
391
+ [Parameter ()]
392
+ [string ]$GalleryToken
393
+ )
394
+ switch ($Assets ) {
395
+ { $_.EndsWith (" .vsix" ) } {
396
+ Write-Output " Uploading VSIX..."
397
+ vsce publish -- packagePath $_ -- pat $VsceToken
398
+ }
399
+ { $_.EndsWith (" .ps1" ) } {
400
+ Write-Output " Uploading PS1..."
401
+ Publish-Script - Path $_ - NuGetApiKey $GalleryToken
402
+ }
403
+ default {
404
+ Write-Error " Unsupported file: $_ "
405
+ }
406
+ }
407
+ }
0 commit comments