Skip to content

Commit c71e5e6

Browse files
Merge pull request #3494 from PowerShell/release
Release `v2021.8.0-preview`
2 parents 9709a75 + f7942d2 commit c71e5e6

File tree

6 files changed

+78
-21
lines changed

6 files changed

+78
-21
lines changed

.vsts-ci/templates/publish-markets.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ steps:
66
displayName: Download signed artifacts
77

88
- pwsh: |
9-
npm install -g vsce
10-
vsce publish --packagePath $(Pipeline.Workspace)/powershell-*.vsix --pat $(VsceToken)
9+
npm ci --loglevel=error
10+
npm run publish -- --packagePath $(Pipeline.Workspace)/vscode-powershell/powershell-*.vsix --pat $(VsceToken)
1111
displayName: Publishing VSIX to VS Code Marketplace
1212

1313
# NOTE: We rarely update this script, so we can ignore errors from the gallery
1414
# caused by us trying to re-publish an updated script.
1515
- pwsh: |
16-
Publish-Script -Path $(Pipeline.Workspace)/Install-VSCode.ps1 -ErrorAction Continue -NuGetApiKey $(GalleryToken)
16+
Publish-Script -Path $(Pipeline.Workspace)/vscode-powershell/Install-VSCode.ps1 -NuGetApiKey $(GalleryToken)
1717
displayName: Publishing Install-VSCode.ps1 to PowerShell Gallery
18+
continueOnError: true

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# PowerShell Extension Release History
22

3+
## v2021.8.0-preview
4+
### Tuesday, August 03, 2021
5+
6+
#### [vscode-powershell](https://github.com/PowerShell/vscode-powershell)
7+
8+
- ✨ 📺 [vscode-powershell #3422](https://github.com/PowerShell/vscode-powershell/pull/3493) - Update extension icon (and use a special preview icon).
9+
- ✨ 👷 [vscode-powershell #2286](https://github.com/PowerShell/vscode-powershell/pull/3461) - Pipeline-ify entire release process.
10+
11+
#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices)
12+
13+
- ✨ 🔍 [PowerShellEditorServices #1533](https://github.com/PowerShell/PowerShellEditorServices/pull/1533) - Enable and fix many .NET Code Analysis warnings.
14+
- ✨ 👷 [PowerShellEditorServices #1530](https://github.com/PowerShell/PowerShellEditorServices/pull/1530) - Update release and CI pipelines.
15+
- ✨ 👷 [PowerShellEditorServices #1528](https://github.com/PowerShell/PowerShellEditorServices/pull/1528) - Automate entire release process.
16+
- ✨ 🛫 [PowerShellEditorServices #1527](https://github.com/PowerShell/PowerShellEditorServices/pull/1527) - Add stack trace to resolve event handler on debug.
17+
- ✨ 🛫 [PowerShellEditorServices #1523](https://github.com/PowerShell/PowerShellEditorServices/pull/1526) - Initialize runspaces with `InitialSessionState` object.
18+
19+
320
## v2021.7.0-preview
421
### Thursday, July 15, 2021
522

docs/development.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@ Microsoft. The comments are manual steps.
6565

6666
```powershell
6767
Import-Module ./tools/ReleaseTools.psm1
68-
Update-Changelog -RepositoryName PowerShellEditorServices -Version <version>
69-
Update-Changelog -RepositoryName vscode-powershell -Version <version>
70-
# Amend changelog as necessary, open PR
68+
New-Release -PsesVersion <version> -VsceVersion <version>
69+
# Amend changelog as necessary
7170
# Push release branches to ADO
7271
# Permit both pipelines to draft GitHub releases
7372
# Download and test assets

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "powershell-preview",
33
"displayName": "PowerShell Preview",
4-
"version": "2021.7.0",
4+
"version": "2021.8.0",
55
"preview": true,
66
"publisher": "ms-vscode",
77
"description": "(Preview) Develop PowerShell modules, commands and scripts in Visual Studio Code!",
@@ -16,7 +16,7 @@
1616
"Snippets",
1717
"Linters"
1818
],
19-
"icon": "media/PowerShell_Icon.png",
19+
"icon": "media/PowerShell_Preview_Icon.png",
2020
"galleryBanner": {
2121
"color": "#ACD1EC",
2222
"theme": "light"
@@ -81,7 +81,9 @@
8181
"scripts": {
8282
"compile": "tsc -v && tsc -p ./ && tslint -p ./",
8383
"compile-watch": "tsc -watch -p ./",
84-
"test": "node ./out/test/runTests.js"
84+
"test": "node ./out/test/runTests.js",
85+
"package": "vsce package --no-gitHubIssueLinking",
86+
"publish": "vsce publish"
8587
},
8688
"contributes": {
8789
"breakpoints": [

tools/ReleaseTools.psm1

+44-9
Original file line numberDiff line numberDiff line change
@@ -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
#>
308307
function 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.

vscode-powershell.build.ps1

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ task Restore -If { !(Test-Path "$PSScriptRoot/node_modules") } {
2727
Write-Host "`n### Restoring vscode-powershell dependencies`n" -ForegroundColor Green
2828
# When in a CI build use the --loglevel=error parameter so that
2929
# package install warnings don't cause PowerShell to throw up
30-
$logLevelParam = if ($env:TF_BUILD) { "--loglevel=error" } else { "" }
31-
exec { & npm install $logLevelParam }
30+
if ($env:TF_BUILD) {
31+
exec { & npm ci --loglevel=error }
32+
} else {
33+
exec { & npm install }
34+
}
3235
}
3336

3437

@@ -106,7 +109,7 @@ task UpdateReadme -If { $script:IsPreviewExtension } {
106109
task Package UpdateReadme, {
107110
assert { Test-Path ./modules/PowerShellEditorServices }
108111
Write-Host "`n### Packaging $($script:PackageJson.name)-$($script:PackageJson.version).vsix`n" -ForegroundColor Green
109-
exec { & node ./node_modules/vsce/out/vsce package --no-gitHubIssueLinking }
112+
exec { & npm run package }
110113
}
111114

112115
#endregion

0 commit comments

Comments
 (0)