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

Fix release note and prebuild scripts #4039

Merged
merged 2 commits into from
Oct 3, 2022
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
6 changes: 4 additions & 2 deletions scripts/vsts-prebuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ param (
[Parameter(Mandatory)]
[string] $IsRtmBuild,
[Parameter(Mandatory)]
$Branch
$Branch,
[Parameter(Mandatory)]
$ForcePreviewOnRelBranch
Evangelink marked this conversation as resolved.
Show resolved Hide resolved
)

$TP_ROOT_DIR = (Get-Item (Split-Path $MyInvocation.MyCommand.Path)).Parent.FullName
Expand All @@ -17,7 +19,7 @@ $buildPrefix = $TpVersion.Trim()

if ($IsRtmBuild.ToLower() -eq "false")
{
if ($null -ne $Branch -and $Branch -like "refs/heads/rel/*")
if ($null -ne $Branch -and $Branch -like "refs/heads/rel/*" -and "false" -eq $ForcePreviewOnRelBranch)
{
$BuildSuffix = $BuildSuffix -replace "preview", "release"
}
Expand Down
6 changes: 5 additions & 1 deletion scripts/vsts-prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ while [ $# -gt 0 ]; do
IS_RTM=$2
shift
;;
-relpreview)
IS_PREVIEW_REL_BRANCH=$2
shift
;;
*)
break
;;
Expand All @@ -40,7 +44,7 @@ if [ $IS_RTM == true ]; then
PACKAGE_VERSION="$TP_BUILD_PREFIX"
TP_BUILD_SUFFIX=
else
if [ ! -z "$BRANCH" ] && [[ $BRANCH =~ ^refs\/heads\/rel\/.*$ ]]; then
if [ ! -z "$BRANCH" ] && [[ $BRANCH =~ ^refs\/heads\/rel\/.*$ ]] && [ $IS_PREVIEW_REL_BRANCH == false ]; then
TP_BUILD_SUFFIX="${TP_BUILD_SUFFIX/preview/release}"
fi

Expand Down
7 changes: 5 additions & 2 deletions scripts/write-release-notes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $repoUrl = $(if ((git -C $Path remote -v) -match "upstream") {

# list all tags on this branch ordered by creator date to get the latest, stable or pre-release tag.
# For stable release we choose only tags without any dash, for pre-release we choose all tags.
$tags = git -C $Path tag -l --sort=creatordate | Where-Object { $_ -match "v\d+\.\d+\.\d+.*" -and (-not $Stable -or $_ -notlike '*-*') }
$tags = git -C $Path tag -l --sort=refname | Where-Object { $_ -match "v\d+\.\d+\.\d+.*" -and (-not $Stable -or $_ -notlike '*-*') }

if ($EndWithLatestCommit) {
# in CI we don't have the tag yet, so we show changes between the most recent tag, and this commit
Expand All @@ -35,6 +35,7 @@ if ($EndWithLatestCommit) {
else {
# normally we show changes between the latest two tags
$start, $end = $tags | Select-Object -Last 2
Write-Host "$start -- $end"
$tag = $end
}

Expand Down Expand Up @@ -95,6 +96,8 @@ $issues = $log | ForEach-Object {
}
}

$vsixDropBranch = $sourceBranch -replace "rel/", ""

$output = @"

See the release notes [here](https://github.com/microsoft/vstest-docs/blob/main/docs/releases.md#$($v -replace '\.')).
Expand All @@ -110,7 +113,7 @@ See full log [here]($repoUrl/compare/$start...$tag)

### Drops

* TestPlatform vsix: [$v](https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/microsoft/vstest/$sourceBranch/$b;/TestPlatform.vsix)
* TestPlatform vsix: [$v](https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/microsoft/vstest/$vsixDropBranch/$b;/TestPlatform.vsix)
* Microsoft.TestPlatform.ObjectModel : [$v](https://www.nuget.org/packages/Microsoft.TestPlatform.ObjectModel/$v)
"@

Expand Down