Update release note scripts to handle spring

This commit is contained in:
Wes Haggard 2022-11-10 16:01:04 -08:00
Родитель 2f26623cf7
Коммит c401ed1ff1
1 изменённых файлов: 25 добавлений и 5 удалений

Просмотреть файл

@ -11,14 +11,16 @@ param (
. (Join-Path $commonScriptPath ChangeLog-Operations.ps1)
. (Join-Path $PSScriptRoot PackageList-Helpers.ps1)
# Temporary replacment for the title regex to discover versions starting with v for go on-boarding until we can normalize those.
$RELEASE_TITLE_REGEX = "(?<releaseNoteTitle>^\#+\s+v?(?<version>$([AzureEngSemanticVersion]::SEMVER_REGEX))(\s+(?<releaseStatus>\(.+\))))"
function GetReleaseNotesData ($packageName, $packageVersion, $packageMetadata)
function GetChangelogBlobLink($packageName, $packageVersion, $packageMetadata)
{
$sourceUrl = GetLinkTemplateValue $langLinkTemplates "source_url_template" $packageName $packageVersion $packageMetadata.RepoPath
if (!$sourceUrl.EndsWith("/")) { $sourceUrl += "/" }
$changelogBlobLink = "${sourceUrl}CHANGELOG.md"
return $changelogBlobLink
}
function GetReleaseNoteContent($packageName, $packageVersion, $changelogBlobLink)
{
$changelogRawLink = $changelogBlobLink -replace "https://github.com/(.*)/(tree|blob)", "https://raw.githubusercontent.com/`$1"
try
{
@ -43,7 +45,6 @@ function GetReleaseNotesData ($packageName, $packageVersion, $packageMetadata)
return $null
}
$packageSemVer = [AzureEngSemanticVersion]::ParseVersionString($packageVersion)
$releaseEntryContent = @()
if ($updatedVersionEntry.Sections.Keys.Count -gt 0)
@ -66,6 +67,13 @@ function GetReleaseNotesData ($packageName, $packageVersion, $packageMetadata)
$releaseEntryContent += BumpUpMDHeaders -content $updatedVersionEntry.ReleaseContent
}
return $releaseEntryContent
}
function GetReleaseNotesData($packageName, $packageVersion, $packageMetadata)
{
$releaseEntryContent = ""
$changelogBlobLink = GetChangelogBlobLink $packageName $packageVersion $packageMetadata
# The management library changelogs are autogenerated and contain much more information
# then we want to display in our release notes so we are clearing the content and
# folks can use the link to the changelog if they want more information on them.
@ -73,6 +81,18 @@ function GetReleaseNotesData ($packageName, $packageVersion, $packageMetadata)
{
$releaseEntryContent = ""
}
elseif ($packageMetadata.Type -eq "spring")
{
$releaseEntryContent = ""
$changelogBlobLink = $changelogBlobLink -replace "$packageName/CHANGELOG.md", "CHANGELOG.md"
Write-Host $changelogBlobLink
}
else
{
$releaseEntryContent = GetReleaseNoteContent $packageName $packageVersion $changelogBlobLink
}
$packageSemVer = [AzureEngSemanticVersion]::ParseVersionString($packageVersion)
$entry = [ordered]@{
Name = $packageName