From f760ea37e968179d52444ae7ac1e30a784e8b938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Mon, 3 Oct 2022 13:14:29 +0200 Subject: [PATCH] Fix release note and prebuild scripts --- scripts/vsts-prebuild.ps1 | 6 ++++-- scripts/vsts-prebuild.sh | 6 +++++- scripts/write-release-notes.ps1 | 7 +++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/vsts-prebuild.ps1 b/scripts/vsts-prebuild.ps1 index 13ca42da99..b98c52a815 100644 --- a/scripts/vsts-prebuild.ps1 +++ b/scripts/vsts-prebuild.ps1 @@ -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 @@ -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" } diff --git a/scripts/vsts-prebuild.sh b/scripts/vsts-prebuild.sh index 34b7a5a653..bbc991ecda 100644 --- a/scripts/vsts-prebuild.sh +++ b/scripts/vsts-prebuild.sh @@ -24,6 +24,10 @@ while [ $# -gt 0 ]; do IS_RTM=$2 shift ;; + -relpreview) + IS_PREVIEW_REL_BRANCH=$2 + shift + ;; *) break ;; @@ -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 diff --git a/scripts/write-release-notes.ps1 b/scripts/write-release-notes.ps1 index 3b16b6eb90..79c8e16135 100644 --- a/scripts/write-release-notes.ps1 +++ b/scripts/write-release-notes.ps1 @@ -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 @@ -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 } @@ -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 '\.')). @@ -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) "@