Skip to content

Commit f760ea3

Browse files
committed
Fix release note and prebuild scripts
1 parent 576a7cc commit f760ea3

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

scripts/vsts-prebuild.ps1

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ param (
66
[Parameter(Mandatory)]
77
[string] $IsRtmBuild,
88
[Parameter(Mandatory)]
9-
$Branch
9+
$Branch,
10+
[Parameter(Mandatory)]
11+
$ForcePreviewOnRelBranch
1012
)
1113

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

1820
if ($IsRtmBuild.ToLower() -eq "false")
1921
{
20-
if ($null -ne $Branch -and $Branch -like "refs/heads/rel/*")
22+
if ($null -ne $Branch -and $Branch -like "refs/heads/rel/*" -and "false" -eq $ForcePreviewOnRelBranch)
2123
{
2224
$BuildSuffix = $BuildSuffix -replace "preview", "release"
2325
}

scripts/vsts-prebuild.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ while [ $# -gt 0 ]; do
2424
IS_RTM=$2
2525
shift
2626
;;
27+
-relpreview)
28+
IS_PREVIEW_REL_BRANCH=$2
29+
shift
30+
;;
2731
*)
2832
break
2933
;;
@@ -40,7 +44,7 @@ if [ $IS_RTM == true ]; then
4044
PACKAGE_VERSION="$TP_BUILD_PREFIX"
4145
TP_BUILD_SUFFIX=
4246
else
43-
if [ ! -z "$BRANCH" ] && [[ $BRANCH =~ ^refs\/heads\/rel\/.*$ ]]; then
47+
if [ ! -z "$BRANCH" ] && [[ $BRANCH =~ ^refs\/heads\/rel\/.*$ ]] && [ $IS_PREVIEW_REL_BRANCH == false ]; then
4448
TP_BUILD_SUFFIX="${TP_BUILD_SUFFIX/preview/release}"
4549
fi
4650

scripts/write-release-notes.ps1

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $repoUrl = $(if ((git -C $Path remote -v) -match "upstream") {
2323

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

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

@@ -95,6 +96,8 @@ $issues = $log | ForEach-Object {
9596
}
9697
}
9798

99+
$vsixDropBranch = $sourceBranch -replace "rel/", ""
100+
98101
$output = @"
99102
100103
See the release notes [here](https://github.com/microsoft/vstest-docs/blob/main/docs/releases.md#$($v -replace '\.')).
@@ -110,7 +113,7 @@ See full log [here]($repoUrl/compare/$start...$tag)
110113
111114
### Drops
112115
113-
* TestPlatform vsix: [$v](https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/microsoft/vstest/$sourceBranch/$b;/TestPlatform.vsix)
116+
* TestPlatform vsix: [$v](https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/microsoft/vstest/$vsixDropBranch/$b;/TestPlatform.vsix)
114117
* Microsoft.TestPlatform.ObjectModel : [$v](https://www.nuget.org/packages/Microsoft.TestPlatform.ObjectModel/$v)
115118
"@
116119

0 commit comments

Comments
 (0)