Skip to content

Commit 3277676

Browse files
Merge pull request #3305 from PowerShell/release/v2021.4.2-preview
Release `v2021.4.2-preview`
2 parents 89d78e1 + 6beb7ce commit 3277676

File tree

3 files changed

+41
-13
lines changed

3 files changed

+41
-13
lines changed

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# PowerShell Extension Release History
22

3+
## v2021.4.2-preview
4+
### Monday, April 26, 2021
5+
6+
#### [vscode-powershell](https://github.com/PowerShell/vscode-powershell)
7+
8+
- 👷✨ [vscode-powershell #3268](https://github.com/PowerShell/vscode-powershell/pull/3292) - Add `Update-Version` to `ReleaseTools` module.
9+
- 👷🐛 [vscode-powershell #3282](https://github.com/PowerShell/vscode-powershell/pull/3286) - Fix release build pipeline.
10+
- 👷✨ [vscode-powershell #3275](https://github.com/PowerShell/vscode-powershell/pull/3275) - Update vsce to 1.87.1.
11+
- 👷✨ [vscode-powershell #3274](https://github.com/PowerShell/vscode-powershell/pull/3274) - Run `npm audit fix`.
12+
13+
#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices)
14+
15+
- 🔍🐛 [PowerShellEditorServices #1460](https://github.com/PowerShell/PowerShellEditorServices/pull/1460) - Bump OmniSharp package to `0.19.2-beta0001`.
16+
- 👷🐛 [PowerShellEditorServices #1455](https://github.com/PowerShell/PowerShellEditorServices/pull/1456) - Fix version in module definition file.
17+
318
## v2021.4.1-preview
419
### Friday, April 02, 2021
520

@@ -11,7 +26,6 @@
1126
- 🚨🐛 [vscode-powershell #3208](https://github.com/PowerShell/vscode-powershell/pull/3222) - Fix hardcoded extension name string.
1227
- 📖🐛 [vscode-powershell #3049](https://github.com/PowerShell/vscode-powershell/pull/3214) - Update examples-module to use Pester 5. (Thanks @nickkimbrough!)
1328
- 🐛 [vscode-powershell #3209](https://github.com/PowerShell/vscode-powershell/pull/3212) - Remove the rest of the experimental Notebook API.
14-
- 👷 [vscode-powershell #3178](https://github.com/PowerShell/vscode-powershell/pull/3207) - Update powershell CHANGELOG for v2021.2.2.
1529

1630
#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices)
1731

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "powershell-preview",
33
"displayName": "PowerShell Preview",
4-
"version": "2021.4.1",
4+
"version": "2021.4.2",
55
"preview": true,
66
"publisher": "ms-vscode",
77
"description": "(Preview) Develop PowerShell scripts in Visual Studio Code!",

tools/ReleaseTools.psm1

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ function Get-Version {
158158
Updates the CHANGELOG file with PRs merged since the last release.
159159
.DESCRIPTION
160160
Uses the local Git repositories but does not pull, so ensure HEAD is where
161-
you want it. Creates a new branch at release/$Version if not already
161+
you want it. Creates a new branch at 'release/$Version' if not already
162162
checked out. Handles any merge option for PRs, but is a little slow as it
163-
queries all closed PRs.
163+
queries all PRs.
164164
#>
165165
function Update-Changelog {
166166
[CmdletBinding(SupportsShouldProcess)]
@@ -178,13 +178,15 @@ function Update-Changelog {
178178

179179
# Get the repo object, latest release, and commits since its tag.
180180
$Repo = Get-GitHubRepository -OwnerName PowerShell -RepositoryName $RepositoryName
181+
# TODO: Handle pre-releases (i.e. treat as latest).
181182
$Release = $Repo | Get-GitHubRelease -Latest
182183
$Commits = git rev-list "$($Release.tag_name)..."
183184

184185
# NOTE: This is a slow API as it gets all PRs, and then filters.
185186
$Bullets = $Repo | Get-GitHubPullRequest -State All |
186187
Where-Object { $_.merge_commit_sha -in $Commits } |
187188
Where-Object { -not $_.user.UserName.EndsWith("[bot]") } |
189+
Where-Object { "Include" -notin $_.labels.LabelName } |
188190
Where-Object { -not $_.title.StartsWith("[Ignore]") } |
189191
Where-Object { -not $_.title.StartsWith("Update CHANGELOG") } |
190192
Where-Object { -not $_.title.StartsWith("Bump version") } |
@@ -193,10 +195,12 @@ function Update-Changelog {
193195
$NewSection = switch ($RepositoryName) {
194196
"vscode-powershell" {
195197
@(
196-
"#### [vscode-powershell](https://github.com/PowerShell/vscode-powershell)`n"
198+
"#### [vscode-powershell](https://github.com/PowerShell/vscode-powershell)"
199+
""
197200
$Bullets
198201
""
199-
"#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices)`n"
202+
"#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices)"
203+
""
200204
(Get-NewChangelog -RepositoryName "PowerShellEditorServices").Where({ $_.StartsWith("- ") }, "SkipUntil")
201205
)
202206
}
@@ -210,8 +214,10 @@ function Update-Changelog {
210214
@(
211215
$CurrentChangelog[0..1]
212216
"## $Version"
213-
"### $([datetime]::Now.ToString('dddd, MMMM dd, yyyy'))`n"
217+
"### $([datetime]::Now.ToString('dddd, MMMM dd, yyyy'))"
218+
""
214219
$NewSection
220+
""
215221
$CurrentChangelog[2..$CurrentChangelog.Length]
216222
) | Set-Content -Encoding utf8NoBOM -Path $ChangelogFile
217223

@@ -309,20 +315,16 @@ function Update-Version {
309315
git commit -m "Bump version to v$Version"
310316
}
311317

312-
if ($PSCmdlet.ShouldProcess("$RepositoryName/v$Version", "git tag")) {
313-
git tag "v$Version"
314-
}
315-
316318
Pop-Location
317319
}
318320

319321
<#
320322
.SYNOPSIS
321-
Creates a new draft GitHub release from the updated changelog.
323+
Creates a new draft GitHub release and Git tag from the updated changelog.
322324
.DESCRIPTION
323325
Requires that the changelog has been updated first as it pulls the release
324326
content and new version number from it. Note that our tags and version name
325-
are prefixed with a `v`.
327+
are prefixed with a `v`. Creates a Git tag if it does not already exist.
326328
#>
327329
function New-DraftRelease {
328330
[CmdletBinding(SupportsShouldProcess)]
@@ -341,6 +343,18 @@ function New-DraftRelease {
341343
PreRelease = [bool]$Version.PreReleaseLabel
342344
# TODO: Pass -WhatIf and -Confirm parameters correctly.
343345
}
346+
347+
if ($PSCmdlet.ShouldProcess("$RepositoryName/v$Version", "git tag")) {
348+
# NOTE: This a side effect neccesary for Git operations to work.
349+
Push-Location -Path "$PSScriptRoot/../../$RepositoryName"
350+
if (-not (git show-ref --tags "v$Version")) {
351+
git tag "v$Version"
352+
} else {
353+
Write-Warning "git tag $RepositoryName/v$Version already exists!"
354+
}
355+
Pop-Location
356+
}
357+
344358
Get-GitHubRepository -OwnerName PowerShell -RepositoryName $RepositoryName |
345359
New-GitHubRelease @ReleaseParams
346360
}

0 commit comments

Comments
 (0)