-
Notifications
You must be signed in to change notification settings - Fork 513
GitHub release script #1937
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
GitHub release script #1937
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
37a095e
Add AzureDataStudio update script
rjmholt 229a611
Copyright headers
rjmholt d14b2c5
Fix ads updater, add vsix version updater script
rjmholt 0695254
Improve existing scripts, add PSES update script
rjmholt 1d68f0c
Fix param name issue
rjmholt bd2001e
Update tools/repoUpdateScripts/updatePsesVersions.ps1
TylerLeonhardt 934f71a
Simplify default parameters, move dir
rjmholt 90b7255
Give proper names to functions
rjmholt aed5afe
Rename functions, fix parameter problems
rjmholt bdd250d
Change segment function verb
rjmholt 45fe271
Add GitHub release script
rjmholt 2616e7c
Generalize release script to work with PSES
rjmholt 3213a6f
Update GH module
rjmholt 93d3a7a
Add requires back in
81110df
Add newlines back in
2347792
Add newline back in
02c015b
Remove redundant default
fa29035
Add comments for function
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
#requires -Version 6.0 | ||
|
||
param( | ||
[Parameter(Mandatory)] | ||
[semver] | ||
$Version, | ||
|
||
[Parameter(Mandatory)] | ||
[string] | ||
$GitHubToken, | ||
|
||
[Parameter(Mandatory)] | ||
[string] | ||
$Repository, | ||
|
||
[Parameter()] | ||
[string] | ||
$TargetFork = 'PowerShell', | ||
|
||
[Parameter()] | ||
[string] | ||
$ChangelogPath = "$PSScriptRoot/../../CHANGELOG.md", | ||
|
||
[Parameter()] | ||
[string[]] | ||
$AssetPath | ||
) | ||
|
||
Import-Module "$PSScriptRoot/../GitHubTools.psm1" -Force | ||
|
||
<# | ||
.SYNOPSIS | ||
Get the release description from the CHANGELOG | ||
|
||
.DESCRIPTION | ||
Gets the latest CHANGELOG entry from the CHANGELOG for use as the GitHub release description | ||
|
||
.PARAMETER ChangelogPath | ||
Path to the changelog file | ||
#> | ||
|
||
function GetDescriptionFromChangelog | ||
{ | ||
param( | ||
[Parameter(Mandatory)] | ||
[string] | ||
$ChangelogPath | ||
) | ||
|
||
$lines = Get-Content -Path $ChangelogPath | ||
# First two lines are the title and newline | ||
# Third looks like '## vX.Y.Z-releasetag' | ||
$sb = [System.Text.StringBuilder]::new($lines[2]) | ||
# Read through until the next '## vX.Y.Z-releasetag' H2 | ||
for ($i = 3; -not $lines[$i].StartsWith('## '); $i++) | ||
{ | ||
$null = $sb.Append("`n").Append($lines[$i]) | ||
} | ||
|
||
return $sb.ToString() | ||
} | ||
|
||
$tag = "v$Version" | ||
|
||
$releaseParams = @{ | ||
Organization = $TargetFork | ||
Repository = $Repository | ||
Tag = $tag | ||
ReleaseName = $tag | ||
Branch = "release/$Version" | ||
AssetPath = $AssetPath | ||
Prerelease = [bool]($Version.PreReleaseLabel) | ||
Description = GetDescriptionFromChangelog -ChangelogPath $ChangelogPath | ||
GitHubToken = $GitHubToken | ||
} | ||
Publish-GitHubRelease @releaseParams |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.