Skip to content
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

added a script to automate creating a release branch and associated pr #2695

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
## Directions

### Initiate the Release
1. Increment the version number and update the Public API files; both of these steps can be accomplished by running the `tools\IncrementVersion.cmd` script. Then create a pull request with these changes and merge it.
1. Increment the version number and update the Public API files; both of these steps can be accomplished by running the `tools\IncrementVersion.cmd` script. Then create a pull request with these changes using the `tools\Release\CreatePullRequest.cmd` script and merge the pull request.
corranrogue9 marked this conversation as resolved.
Show resolved Hide resolved
* Increment the version number referenced during build in [`Versioning.props`](tools/CustomMSBuild/Versioning.props) by using [semantic versioning](https://semver.org/).
* Update the Public API files by copying the contents of any `PublicAPI.Unshipped.txt` file that has changed since the last release into its corresponding `PublicAPI.Shipped.txt` file.
2. Kick off a new [nightly build](https://identitydivision.visualstudio.com/OData/_build?definitionId=1104) by running the pipeline to generate the NuGet packages that will be published for this release.
Expand Down
3 changes: 3 additions & 0 deletions tools/Release/CreatePullRequest.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

powershell.exe -executionpolicy remotesigned -File %~dpn0.ps1 %*
48 changes: 48 additions & 0 deletions tools/Release/CreatePullRequest.ps1
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"
KenitoInc marked this conversation as resolved.
Show resolved Hide resolved

$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"
corranrogue9 marked this conversation as resolved.
Show resolved Hide resolved

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"