@@ -278,8 +278,6 @@ function Update-Changelog {
278
278
git commit - m " Update CHANGELOG for `` $Version `` "
279
279
}
280
280
}
281
-
282
- Update-Version - RepositoryName $RepositoryName
283
281
}
284
282
285
283
<#
@@ -304,6 +302,7 @@ function Update-Changelog {
304
302
- `name` field has `-preview` appended similarly
305
303
- `displayName` field has ` Preview` appended similarly
306
304
- `description` field has `(Preview) ` prepended similarly
305
+ - `icon` field has `_Preview ` inserted similarly
307
306
#>
308
307
function Update-Version {
309
308
[CmdletBinding (SupportsShouldProcess )]
@@ -369,8 +368,6 @@ function Update-Version {
369
368
git commit - m " Bump version to `` v$Version `` "
370
369
} # TODO: Git reset to unstage
371
370
}
372
-
373
- New-ReleasePR - RepositoryName $RepositoryName
374
371
}
375
372
376
373
<#
@@ -387,20 +384,19 @@ function New-ReleasePR {
387
384
[string ]$RepositoryName
388
385
)
389
386
$Version = Get-Version - RepositoryName $RepositoryName
390
- $Branch = " release/v$Version "
391
387
392
388
Update-Branch - RepositoryName $RepositoryName
393
389
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
397
393
}
398
394
}
399
395
400
396
$Repo = Get-GitHubRepository - OwnerName PowerShell - RepositoryName $RepositoryName
401
397
402
398
$Params = @ {
403
- Head = $Branch
399
+ Head = " release "
404
400
Base = " master"
405
401
Draft = $true
406
402
Title = " Release `` v$Version `` "
@@ -416,6 +412,45 @@ function New-ReleasePR {
416
412
$Repo | Add-GitHubIssueLabel - Issue $PR.PullRequestNumber - LabelName " Ignore"
417
413
}
418
414
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
+
419
454
<#
420
455
. SYNOPSIS
421
456
Creates a new draft GitHub release and Git tag from the updated changelog.
0 commit comments