-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a script to automate creating a release branch and associated pr (
#2695) * added a script to automate creating a release branch and associated pr * updated script name to be more accurate
- Loading branch information
1 parent
bb5db4b
commit b144ff8
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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,3 @@ | ||
@echo off | ||
|
||
powershell.exe -executionpolicy remotesigned -File %~dpn0.ps1 %* |
This file contains 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,48 @@ | ||
<# | ||
.PARAMETER versionPath | ||
The path to the msbuild props file where the version number is specified | ||
#> | ||
|
||
Param( | ||
[string] | ||
$versionPath | ||
) | ||
|
||
if ($versionPath -eq "") | ||
{ | ||
$versionPath = "$PSScriptRoot\..\CustomMSBuild\Versioning.props" | ||
} | ||
|
||
$versions = New-Object xml | ||
$versions.PreserveWhitespace = $true | ||
$versions.Load($versionPath) | ||
foreach ($propertyGroup in $versions.Project.PropertyGroup) | ||
{ | ||
if ($propertyGroup.VersionRelease -ne $null) | ||
{ | ||
$versionNumber = $propertyGroup.VersionMajor.'#text' + "." + $propertyGroup.VersionMinor.'#text' + "." + $propertyGroup.VersionBuildNumber.'#text' | ||
|
||
break; | ||
} | ||
} | ||
|
||
if ($versionNumber -eq $null) | ||
{ | ||
Write-Error "No version number was found in $versionPath." | ||
Exit | ||
} | ||
|
||
$branchName = "releases/$versionNumber" | ||
|
||
$branchName | ||
|
||
git checkout -b $branchName | ||
|
||
git add * | ||
git commit -m "revving version number to $versionNumber and updating PublicAPI.Shipped.txt files to reflect API changes for this release" | ||
|
||
git push --set-upstream origin $branchName | ||
|
||
Write-Host | ||
Write-Host -ForegroundColor Green "A new release branch at $branchName has been created and pushed; create a PR for that branch by navigating to:" | ||
Write-Host -ForegroundColor Green "https://github.com/OData/odata.net/compare/master...$branchName" |