Skip to content

Release v2021.4.2-preview #3305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# PowerShell Extension Release History

## v2021.4.2-preview
### Monday, April 26, 2021

#### [vscode-powershell](https://github.com/PowerShell/vscode-powershell)

- 👷✨ [vscode-powershell #3268](https://github.com/PowerShell/vscode-powershell/pull/3292) - Add `Update-Version` to `ReleaseTools` module.
- 👷🐛 [vscode-powershell #3282](https://github.com/PowerShell/vscode-powershell/pull/3286) - Fix release build pipeline.
- 👷✨ [vscode-powershell #3275](https://github.com/PowerShell/vscode-powershell/pull/3275) - Update vsce to 1.87.1.
- 👷✨ [vscode-powershell #3274](https://github.com/PowerShell/vscode-powershell/pull/3274) - Run `npm audit fix`.

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

- 🔍🐛 [PowerShellEditorServices #1460](https://github.com/PowerShell/PowerShellEditorServices/pull/1460) - Bump OmniSharp package to `0.19.2-beta0001`.
- 👷🐛 [PowerShellEditorServices #1455](https://github.com/PowerShell/PowerShellEditorServices/pull/1456) - Fix version in module definition file.

## v2021.4.1-preview
### Friday, April 02, 2021

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

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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "powershell-preview",
"displayName": "PowerShell Preview",
"version": "2021.4.1",
"version": "2021.4.2",
"preview": true,
"publisher": "ms-vscode",
"description": "(Preview) Develop PowerShell scripts in Visual Studio Code!",
Expand Down
36 changes: 25 additions & 11 deletions tools/ReleaseTools.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ function Get-Version {
Updates the CHANGELOG file with PRs merged since the last release.
.DESCRIPTION
Uses the local Git repositories but does not pull, so ensure HEAD is where
you want it. Creates a new branch at release/$Version if not already
you want it. Creates a new branch at 'release/$Version' if not already
checked out. Handles any merge option for PRs, but is a little slow as it
queries all closed PRs.
queries all PRs.
#>
function Update-Changelog {
[CmdletBinding(SupportsShouldProcess)]
Expand All @@ -178,13 +178,15 @@ function Update-Changelog {

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

# NOTE: This is a slow API as it gets all PRs, and then filters.
$Bullets = $Repo | Get-GitHubPullRequest -State All |
Where-Object { $_.merge_commit_sha -in $Commits } |
Where-Object { -not $_.user.UserName.EndsWith("[bot]") } |
Where-Object { "Include" -notin $_.labels.LabelName } |
Where-Object { -not $_.title.StartsWith("[Ignore]") } |
Where-Object { -not $_.title.StartsWith("Update CHANGELOG") } |
Where-Object { -not $_.title.StartsWith("Bump version") } |
Expand All @@ -193,10 +195,12 @@ function Update-Changelog {
$NewSection = switch ($RepositoryName) {
"vscode-powershell" {
@(
"#### [vscode-powershell](https://github.com/PowerShell/vscode-powershell)`n"
"#### [vscode-powershell](https://github.com/PowerShell/vscode-powershell)"
""
$Bullets
""
"#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices)`n"
"#### [PowerShellEditorServices](https://github.com/PowerShell/PowerShellEditorServices)"
""
(Get-NewChangelog -RepositoryName "PowerShellEditorServices").Where({ $_.StartsWith("- ") }, "SkipUntil")
)
}
Expand All @@ -210,8 +214,10 @@ function Update-Changelog {
@(
$CurrentChangelog[0..1]
"## $Version"
"### $([datetime]::Now.ToString('dddd, MMMM dd, yyyy'))`n"
"### $([datetime]::Now.ToString('dddd, MMMM dd, yyyy'))"
""
$NewSection
""
$CurrentChangelog[2..$CurrentChangelog.Length]
) | Set-Content -Encoding utf8NoBOM -Path $ChangelogFile

Expand Down Expand Up @@ -309,20 +315,16 @@ function Update-Version {
git commit -m "Bump version to v$Version"
}

if ($PSCmdlet.ShouldProcess("$RepositoryName/v$Version", "git tag")) {
git tag "v$Version"
}

Pop-Location
}

<#
.SYNOPSIS
Creates a new draft GitHub release from the updated changelog.
Creates a new draft GitHub release and Git tag from the updated changelog.
.DESCRIPTION
Requires that the changelog has been updated first as it pulls the release
content and new version number from it. Note that our tags and version name
are prefixed with a `v`.
are prefixed with a `v`. Creates a Git tag if it does not already exist.
#>
function New-DraftRelease {
[CmdletBinding(SupportsShouldProcess)]
Expand All @@ -341,6 +343,18 @@ function New-DraftRelease {
PreRelease = [bool]$Version.PreReleaseLabel
# TODO: Pass -WhatIf and -Confirm parameters correctly.
}

if ($PSCmdlet.ShouldProcess("$RepositoryName/v$Version", "git tag")) {
# NOTE: This a side effect neccesary for Git operations to work.
Push-Location -Path "$PSScriptRoot/../../$RepositoryName"
if (-not (git show-ref --tags "v$Version")) {
git tag "v$Version"
} else {
Write-Warning "git tag $RepositoryName/v$Version already exists!"
}
Pop-Location
}

Get-GitHubRepository -OwnerName PowerShell -RepositoryName $RepositoryName |
New-GitHubRelease @ReleaseParams
}
Expand Down