Skip to content

Release v2021.8.0-preview #3494

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 6 commits into from
Aug 5, 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
7 changes: 4 additions & 3 deletions .vsts-ci/templates/publish-markets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ steps:
displayName: Download signed artifacts

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

# NOTE: We rarely update this script, so we can ignore errors from the gallery
# caused by us trying to re-publish an updated script.
- pwsh: |
Publish-Script -Path $(Pipeline.Workspace)/Install-VSCode.ps1 -ErrorAction Continue -NuGetApiKey $(GalleryToken)
Publish-Script -Path $(Pipeline.Workspace)/vscode-powershell/Install-VSCode.ps1 -NuGetApiKey $(GalleryToken)
displayName: Publishing Install-VSCode.ps1 to PowerShell Gallery
continueOnError: true
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# PowerShell Extension Release History

## v2021.8.0-preview
### Tuesday, August 03, 2021

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

- ✨ 📺 [vscode-powershell #3422](https://github.com/PowerShell/vscode-powershell/pull/3493) - Update extension icon (and use a special preview icon).
- ✨ 👷 [vscode-powershell #2286](https://github.com/PowerShell/vscode-powershell/pull/3461) - Pipeline-ify entire release process.

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

- ✨ 🔍 [PowerShellEditorServices #1533](https://github.com/PowerShell/PowerShellEditorServices/pull/1533) - Enable and fix many .NET Code Analysis warnings.
- ✨ 👷 [PowerShellEditorServices #1530](https://github.com/PowerShell/PowerShellEditorServices/pull/1530) - Update release and CI pipelines.
- ✨ 👷 [PowerShellEditorServices #1528](https://github.com/PowerShell/PowerShellEditorServices/pull/1528) - Automate entire release process.
- ✨ 🛫 [PowerShellEditorServices #1527](https://github.com/PowerShell/PowerShellEditorServices/pull/1527) - Add stack trace to resolve event handler on debug.
- ✨ 🛫 [PowerShellEditorServices #1523](https://github.com/PowerShell/PowerShellEditorServices/pull/1526) - Initialize runspaces with `InitialSessionState` object.


## v2021.7.0-preview
### Thursday, July 15, 2021

Expand Down
5 changes: 2 additions & 3 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ Microsoft. The comments are manual steps.

```powershell
Import-Module ./tools/ReleaseTools.psm1
Update-Changelog -RepositoryName PowerShellEditorServices -Version <version>
Update-Changelog -RepositoryName vscode-powershell -Version <version>
# Amend changelog as necessary, open PR
New-Release -PsesVersion <version> -VsceVersion <version>
# Amend changelog as necessary
# Push release branches to ADO
# Permit both pipelines to draft GitHub releases
# Download and test assets
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "powershell-preview",
"displayName": "PowerShell Preview",
"version": "2021.7.0",
"version": "2021.8.0",
"preview": true,
"publisher": "ms-vscode",
"description": "(Preview) Develop PowerShell modules, commands and scripts in Visual Studio Code!",
Expand All @@ -16,7 +16,7 @@
"Snippets",
"Linters"
],
"icon": "media/PowerShell_Icon.png",
"icon": "media/PowerShell_Preview_Icon.png",
"galleryBanner": {
"color": "#ACD1EC",
"theme": "light"
Expand Down Expand Up @@ -81,7 +81,9 @@
"scripts": {
"compile": "tsc -v && tsc -p ./ && tslint -p ./",
"compile-watch": "tsc -watch -p ./",
"test": "node ./out/test/runTests.js"
"test": "node ./out/test/runTests.js",
"package": "vsce package --no-gitHubIssueLinking",
"publish": "vsce publish"
},
"contributes": {
"breakpoints": [
Expand Down
53 changes: 44 additions & 9 deletions tools/ReleaseTools.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,6 @@ function Update-Changelog {
git commit -m "Update CHANGELOG for ``$Version``"
}
}

Update-Version -RepositoryName $RepositoryName
}

<#
Expand All @@ -304,6 +302,7 @@ function Update-Changelog {
- `name` field has `-preview` appended similarly
- `displayName` field has ` Preview` appended similarly
- `description` field has `(Preview) ` prepended similarly
- `icon` field has `_Preview ` inserted similarly
#>
function Update-Version {
[CmdletBinding(SupportsShouldProcess)]
Expand Down Expand Up @@ -369,8 +368,6 @@ function Update-Version {
git commit -m "Bump version to ``v$Version``"
} # TODO: Git reset to unstage
}

New-ReleasePR -RepositoryName $RepositoryName
}

<#
Expand All @@ -387,20 +384,19 @@ function New-ReleasePR {
[string]$RepositoryName
)
$Version = Get-Version -RepositoryName $RepositoryName
$Branch = "release/v$Version"

Update-Branch -RepositoryName $RepositoryName
Use-Repository -RepositoryName $RepositoryName -Script {
if ($PSCmdlet.ShouldProcess("$RepositoryName/$Branch", "git push")) {
Write-Host "Pushing branch ``$Branch``..."
git push origin $Branch
if ($PSCmdlet.ShouldProcess("$RepositoryName/release", "git push")) {
Write-Host "Pushing release branch..."
git push --force-with-lease origin release
}
}

$Repo = Get-GitHubRepository -OwnerName PowerShell -RepositoryName $RepositoryName

$Params = @{
Head = $Branch
Head = "release"
Base = "master"
Draft = $true
Title = "Release ``v$Version``"
Expand All @@ -416,6 +412,45 @@ function New-ReleasePR {
$Repo | Add-GitHubIssueLabel -Issue $PR.PullRequestNumber -LabelName "Ignore"
}

<#
.SYNOPSIS
Kicks off the whole release process.
.DESCRIPTION
This first updates the changelog (which creates and checks out the `release`
branch), commits the changes, updates the version (and commits), pushes the
branch, and then creates a GitHub PR for the release for both repositories.

This is the function meant to be called by a maintainer as the first manual
step to creating a release: it calls the correct functions in order to prepare
the release. Each repository's release branch then needs to be pushed to the
internal Azure DevOps mirror, at which point the automatic release pipeline
will build and sign the assets, and queue up draft GitHub releases (using
`New-DraftRelease` below). Those releases need to be manually validated and
approved, and finally the last step is to approve the pipeline to publish the
assets to the marketplace and gallery.
#>
function New-Release {
[CmdletBinding(SupportsShouldProcess)]
param(
[Parameter(Mandatory)]
[ValidateScript({ $_.StartsWith("v") })]
[string]$PsesVersion,

[Parameter(Mandatory)]
[ValidateScript({ $_.StartsWith("v") })]
[string]$VsceVersion
)
"PowerShellEditorServices", "vscode-powershell" | ForEach-Object {
$Version = switch ($_) {
"PowerShellEditorServices" { $PsesVersion }
"vscode-powershell" { $VsceVersion }
}
Update-Changelog -RepositoryName $_ -Version $Version
Update-Version -RepositoryName $_
New-ReleasePR -RepositoryName $_
}
}

<#
.SYNOPSIS
Creates a new draft GitHub release and Git tag from the updated changelog.
Expand Down
9 changes: 6 additions & 3 deletions vscode-powershell.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ task Restore -If { !(Test-Path "$PSScriptRoot/node_modules") } {
Write-Host "`n### Restoring vscode-powershell dependencies`n" -ForegroundColor Green
# When in a CI build use the --loglevel=error parameter so that
# package install warnings don't cause PowerShell to throw up
$logLevelParam = if ($env:TF_BUILD) { "--loglevel=error" } else { "" }
exec { & npm install $logLevelParam }
if ($env:TF_BUILD) {
exec { & npm ci --loglevel=error }
} else {
exec { & npm install }
}
}


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

#endregion
Expand Down