Skip to content

Commit

Permalink
Fix release note and prebuild scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink committed Oct 3, 2022
1 parent 576a7cc commit f760ea3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
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
)

$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

0 comments on commit f760ea3

Please sign in to comment.