Skip to content

Commit 3ef8227

Browse files
Fix version suffix on dotnet pack
1 parent ba53199 commit 3ef8227

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Build.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,22 @@ $commitHash = $(git rev-parse --short HEAD)
1616
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1717

1818
echo "build: Package version suffix is $suffix"
19-
echo "build: Build version suffix is $buildSuffix"
19+
echo "build: Build version suffix is $buildSuffix"
2020

2121
foreach ($src in ls src/*) {
2222
Push-Location $src
2323

2424
echo "build: Packaging project in $src"
2525

2626
& dotnet build -c Release --version-suffix=$buildSuffix
27-
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix --no-build
28-
if($LASTEXITCODE -ne 0) { exit 1 }
27+
if($suffix -ne "") {
28+
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix --no-build
29+
}
30+
else {
31+
& dotnet pack -c Release -o ..\..\artifacts --no-build
32+
}
33+
34+
if($LASTEXITCODE -ne 0) { exit 1 }
2935

3036
Pop-Location
3137
}

0 commit comments

Comments
 (0)