diff --git a/.pipelines/03_pack.cmd b/.pipelines/03_pack.cmd index f26eeadcf0..ef4f5bda62 100644 --- a/.pipelines/03_pack.cmd +++ b/.pipelines/03_pack.cmd @@ -1,3 +1,9 @@ cd /D "%~dp0..\" dotnet pack .\ProjectsForSigning.sln %* --configuration Release --no-restore --no-build || exit /b 1 + + +setlocal enabledelayedexpansion +powershell.exe -ExecutionPolicy Unrestricted -NoProfile -WindowStyle Hidden -File "./.scripts/release_GenerateReleaseMetadata.ps1" -artifactsPath "./bin/Release/NuGet" -sourcePath "./" -outPath "./bin/Release/NuGet" +endlocal +exit /B %ERRORLEVEL% diff --git a/.scripts/release_GenerateReleaseMetadata.ps1 b/.scripts/release_GenerateReleaseMetadata.ps1 index 770e209328..c3f53cf4dc 100644 --- a/.scripts/release_GenerateReleaseMetadata.ps1 +++ b/.scripts/release_GenerateReleaseMetadata.ps1 @@ -5,7 +5,7 @@ Param( [Parameter(Mandatory=$true,HelpMessage="Path to Source files (changelog):")] [string] $sourcePath, - [Parameter(Mandatory=$false,HelpMessage="Path to save metadata:")] + [Parameter(Mandatory=$true,HelpMessage="Path to save metadata:")] [string] $outPath ) @@ -160,6 +160,12 @@ Function Get-ChangelogText ([string]$sourcePath, [string]$versionName) { } Function Save-ToXml([string]$outPath, [ReleaseInfo]$object) { + + if ( -not (Test-Path -Path $outPath -PathType Container) ) + { + throw "Output directory does not exist: '$($outPath)'." + } + $outFilePath = Join-Path $outPath "releaseMetaData.xml" $xmlWriter = [System.XMl.XmlTextWriter]::new($outFilePath, $Null) $xmlWriter.Formatting = "Indented"