@@ -9,7 +9,18 @@ Write-Host "======================================" -ForegroundColor Cyan
99
1010# Get version from Directory.Build.props
1111$version = (Select-Xml - Path Directory.Build.props - XPath ' /Project/PropertyGroup/Version' ).Node.' #text'
12+
13+ # NuGet normalizes version by removing trailing zero segments
14+ # For example: X.Y.Z.0 becomes X.Y.Z, but X.Y.Z.W (where W != 0) stays as is
15+ $versionParts = $version.Split (' .' )
16+ $packageVersion = $version
17+ if ($versionParts.Length -eq 4 -and $versionParts [3 ] -eq ' 0' ) {
18+ $packageVersion = " $ ( $versionParts [0 ]) .$ ( $versionParts [1 ]) .$ ( $versionParts [2 ]) "
19+ Write-Host " `n Note: Version $version will be normalized to $packageVersion in package names" - ForegroundColor Yellow
20+ }
21+
1222Write-Host " `n Version: $version " - ForegroundColor Yellow
23+ Write-Host " Package Version: $packageVersion " - ForegroundColor Yellow
1324
1425# Check if we're on the correct branch
1526$currentBranch = git rev- parse -- abbrev- ref HEAD
@@ -69,11 +80,11 @@ if ($LASTEXITCODE -ne 0) {
6980
7081Write-Host " `n Packages to be published:" - ForegroundColor Cyan
7182$packages = @ (
72- " .\FFmpeg.AutoGen\bin\Release\FFmpeg.AutoGen.$version .nupkg" ,
73- " .\FFmpeg.AutoGen.Abstractions\bin\Release\FFmpeg.AutoGen.Abstractions.$version .nupkg" ,
74- " .\FFmpeg.AutoGen.Bindings.DynamicallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLinked.$version .nupkg" ,
75- " .\FFmpeg.AutoGen.Bindings.DynamicallyLoaded\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLoaded.$version .nupkg" ,
76- " .\FFmpeg.AutoGen.Bindings.StaticallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.StaticallyLinked.$version .nupkg"
83+ " .\FFmpeg.AutoGen\bin\Release\FFmpeg.AutoGen.$packageVersion .nupkg" ,
84+ " .\FFmpeg.AutoGen.Abstractions\bin\Release\FFmpeg.AutoGen.Abstractions.$packageVersion .nupkg" ,
85+ " .\FFmpeg.AutoGen.Bindings.DynamicallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLinked.$packageVersion .nupkg" ,
86+ " .\FFmpeg.AutoGen.Bindings.DynamicallyLoaded\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLoaded.$packageVersion .nupkg" ,
87+ " .\FFmpeg.AutoGen.Bindings.StaticallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.StaticallyLinked.$packageVersion .nupkg"
7788)
7889
7990foreach ($pkg in $packages ) {
0 commit comments