Skip to content

Commit ee7b687

Browse files
Use Release config when parsing NuGet package metadata
Explicitly set the msbuild configuration to Release when retrieving PackageId, PackageVersion, and PackageOutputPath. This ensures metadata is consistent with the published package.
1 parent 596b267 commit ee7b687

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/pack-and-publish-nuget-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
id: get-package-metadata
6868
working-directory: src/${{ env.PROJECT_NAME }}
6969
run: |
70-
$packageId, $packageVersion, $packageOutputPath = dotnet msbuild -getProperty:PackageId,PackageVersion,PackageOutputPath | ConvertFrom-Json | % { $_.Properties.PackageId, $_.Properties.PackageVersion, $_.Properties.PackageOutputPath }
70+
$packageId, $packageVersion, $packageOutputPath = dotnet msbuild -property:Configuration=Release -getProperty:PackageId,PackageVersion,PackageOutputPath | ConvertFrom-Json | % { $_.Properties.PackageId, $_.Properties.PackageVersion, $_.Properties.PackageOutputPath }
7171
if ($packageId -cne $env:PROJECT_NAME) {
7272
Write-Error "NuGet package id `"$packageId`" does not match expected project name `"$env:PROJECT_NAME`""
7373
}

0 commit comments

Comments
 (0)