Skip to content

Commit dbaea3c

Browse files
Merge pull request #3361 from PowerShell/andschwa/release-tools
Fix another bug in `ReleaseTools`
2 parents 67fad24 + 1022a60 commit dbaea3c

File tree

2 files changed

+5
-40
lines changed

2 files changed

+5
-40
lines changed

tools/ReleaseTools.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ function Get-FirstChangelog {
125125
[string]$RepositoryName
126126
)
127127
$Changelog = Get-Content -Path "$PSScriptRoot/../../$RepositoryName/$ChangelogFile"
128+
# NOTE: The space after the header marker is important! Otherwise ### matches.
129+
$Header = $Changelog.Where({$_.StartsWith("## ")}, "First")
128130
$Changelog.Where(
129-
{ $_.StartsWith("##") }, "SkipUntil"
131+
{ $_ -eq $Header }, "SkipUntil"
130132
).Where(
131-
{ $_.StartsWith("##") }, "Until"
133+
{ $_.StartsWith("## ") -and $_ -ne $Header }, "Until"
132134
)
133135
}
134136

@@ -355,5 +357,3 @@ function New-DraftRelease {
355357
Get-GitHubRepository -OwnerName PowerShell -RepositoryName $RepositoryName |
356358
New-GitHubRelease @ReleaseParams
357359
}
358-
359-
Export-ModuleMember -Function Update-Changelog, Update-Version, New-DraftRelease

vscode-powershell.build.ps1

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -137,41 +137,6 @@ task UpdateReadme -If { $script:IsPreviewExtension } {
137137
}
138138
}
139139

140-
task UpdatePackageJson {
141-
if ($script:IsPreviewExtension) {
142-
$script:PackageJson.name = "powershell-preview"
143-
$script:PackageJson.displayName = "PowerShell Preview"
144-
$script:PackageJson.description = "(Preview) Develop PowerShell modules, commands and scripts in Visual Studio Code!"
145-
$script:PackageJson.preview = $true
146-
} else {
147-
$script:PackageJson.name = "powershell"
148-
$script:PackageJson.displayName = "PowerShell"
149-
$script:PackageJson.description = "Develop PowerShell modules, commands and scripts in Visual Studio Code!"
150-
$script:PackageJson.preview = $false
151-
}
152-
153-
$currentVersion = [version](($script:PackageJson.version -split "-")[0])
154-
$currentDate = Get-Date
155-
156-
$revision = if ($currentDate.Month -eq $currentVersion.Minor) {
157-
$currentVersion.Build + 1
158-
} else {
159-
0
160-
}
161-
162-
$script:PackageJson.version = "$($currentDate.ToString('yyyy.M')).$revision"
163-
164-
if ($env:TF_BUILD) {
165-
$script:PackageJson.version += "-CI.$env:BUILD_BUILDID"
166-
}
167-
168-
$Utf8NoBomEncoding = [System.Text.UTF8Encoding]::new($false)
169-
[System.IO.File]::WriteAllLines(
170-
(Resolve-Path "$PSScriptRoot/package.json").Path,
171-
($script:PackageJson | ConvertTo-Json -Depth 100),
172-
$Utf8NoBomEncoding)
173-
}
174-
175140
task Package UpdateReadme, {
176141
if ($script:psesBuildScriptPath -or $env:TF_BUILD) {
177142
Write-Host "`n### Copying PowerShellEditorServices module files" -ForegroundColor Green
@@ -197,4 +162,4 @@ task Package UpdateReadme, {
197162
# The set of tasks for a release
198163
task Release Clean, Build, Package
199164
# The default task is to run the entire CI build
200-
task . CleanAll, BuildAll, Test, UpdatePackageJson, Package, UploadArtifacts
165+
task . CleanAll, BuildAll, Test, Package, UploadArtifacts

0 commit comments

Comments
 (0)