@@ -278,8 +278,6 @@ function Update-Changelog {
278278 git commit - m " Update CHANGELOG for `` $Version `` "
279279 }
280280 }
281-
282- Update-Version - RepositoryName $RepositoryName
283281}
284282
285283<#
@@ -304,6 +302,7 @@ function Update-Changelog {
304302 - `name` field has `-preview` appended similarly
305303 - `displayName` field has ` Preview` appended similarly
306304 - `description` field has `(Preview) ` prepended similarly
305+ - `icon` field has `_Preview ` inserted similarly
307306#>
308307function Update-Version {
309308 [CmdletBinding (SupportsShouldProcess )]
@@ -369,8 +368,6 @@ function Update-Version {
369368 git commit - m " Bump version to `` v$Version `` "
370369 } # TODO: Git reset to unstage
371370 }
372-
373- New-ReleasePR - RepositoryName $RepositoryName
374371}
375372
376373<#
@@ -387,20 +384,19 @@ function New-ReleasePR {
387384 [string ]$RepositoryName
388385 )
389386 $Version = Get-Version - RepositoryName $RepositoryName
390- $Branch = " release/v$Version "
391387
392388 Update-Branch - RepositoryName $RepositoryName
393389 Use-Repository - RepositoryName $RepositoryName - Script {
394- if ($PSCmdlet.ShouldProcess (" $RepositoryName /$Branch " , " git push" )) {
395- Write-Host " Pushing branch `` $Branch `` ..."
396- git push origin $Branch
390+ if ($PSCmdlet.ShouldProcess (" $RepositoryName /release " , " git push" )) {
391+ Write-Host " Pushing release branch ..."
392+ git push -- force - with - lease origin release
397393 }
398394 }
399395
400396 $Repo = Get-GitHubRepository - OwnerName PowerShell - RepositoryName $RepositoryName
401397
402398 $Params = @ {
403- Head = $Branch
399+ Head = " release "
404400 Base = " master"
405401 Draft = $true
406402 Title = " Release `` v$Version `` "
@@ -416,6 +412,45 @@ function New-ReleasePR {
416412 $Repo | Add-GitHubIssueLabel - Issue $PR.PullRequestNumber - LabelName " Ignore"
417413}
418414
415+ <#
416+ . SYNOPSIS
417+ Kicks off the whole release process.
418+ . DESCRIPTION
419+ This first updates the changelog (which creates and checks out the `release`
420+ branch), commits the changes, updates the version (and commits), pushes the
421+ branch, and then creates a GitHub PR for the release for both repositories.
422+
423+ This is the function meant to be called by a maintainer as the first manual
424+ step to creating a release: it calls the correct functions in order to prepare
425+ the release. Each repository's release branch then needs to be pushed to the
426+ internal Azure DevOps mirror, at which point the automatic release pipeline
427+ will build and sign the assets, and queue up draft GitHub releases (using
428+ `New-DraftRelease` below). Those releases need to be manually validated and
429+ approved, and finally the last step is to approve the pipeline to publish the
430+ assets to the marketplace and gallery.
431+ #>
432+ function New-Release {
433+ [CmdletBinding (SupportsShouldProcess )]
434+ param (
435+ [Parameter (Mandatory )]
436+ [ValidateScript ({ $_.StartsWith (" v" ) })]
437+ [string ]$PsesVersion ,
438+
439+ [Parameter (Mandatory )]
440+ [ValidateScript ({ $_.StartsWith (" v" ) })]
441+ [string ]$VsceVersion
442+ )
443+ " PowerShellEditorServices" , " vscode-powershell" | ForEach-Object {
444+ $Version = switch ($_ ) {
445+ " PowerShellEditorServices" { $PsesVersion }
446+ " vscode-powershell" { $VsceVersion }
447+ }
448+ Update-Changelog - RepositoryName $_ - Version $Version
449+ Update-Version - RepositoryName $_
450+ New-ReleasePR - RepositoryName $_
451+ }
452+ }
453+
419454<#
420455. SYNOPSIS
421456 Creates a new draft GitHub release and Git tag from the updated changelog.
0 commit comments