@@ -11,40 +11,47 @@ $solutionDir = Get-SolutionDirectory
1111Set-Location $solutionDir
1212
1313# Ensure GitVersion environment variables are set
14- Ensure- GitVersion- Environment
15-
16- # Build the project with the version information applied
17- Build-Project - Configuration $BuildType
14+ Ensure- GitVersion- Environment
1815
1916$solutionName = Split-Path $solutionDir - Leaf
2017
21- # Output directory
22- $releaseDir = Join-Path $solutionDir " src\ $solutionName \bin\ Release"
18+ # Build and package for each release configuration
19+ $configurations = @ ( " Release" , " ReleaseNoMemoryPack " )
2320
24- # Ensure release directory exists
25- if (Test-Path $releaseDir ) {
26- Get-ChildItem - Path $releaseDir - Directory | ForEach-Object {
27- $targetDir = $_.FullName
28- $frameworkName = $_.Name
21+ foreach ($config in $configurations ) {
22+ # Build the project with the current configuration
23+ Build-Project - Configuration $config
2924
30- # Construct final archive name
31- $zipFileName = " ${solutionName} -v$ ( $Env: GitVersion_FullSemVer ) -${frameworkName} -release.zip"
32- $zipPath = Join-Path $releaseDir $zipFileName
25+ # Output directory for this configuration
26+ $releaseDir = Join-Path $solutionDir " src\$solutionName \bin\$config "
3327
34- Write-Host " Creating archive: $zipPath "
28+ # Determine archive label suffix (lowercase, hyphen-separated)
29+ $configLabel = $config.ToLower () -replace " release" , " release" # keeps "release" / "releasenomemorypack"
3530
36- if (Test-Path $zipPath ) {
37- Remove-Item $zipPath - Force
38- }
31+ if (Test-Path $releaseDir ) {
32+ Get-ChildItem - Path $releaseDir - Directory | ForEach-Object {
33+ $targetDir = $_.FullName
34+ $frameworkName = $_.Name
35+
36+ # Construct final archive name
37+ $zipFileName = " ${solutionName} -v$ ( $Env: GitVersion_FullSemVer ) -${frameworkName} -${configLabel} .zip"
38+ $zipPath = Join-Path $releaseDir $zipFileName
39+
40+ Write-Host " Creating archive: $zipPath "
41+
42+ if (Test-Path $zipPath ) {
43+ Remove-Item $zipPath - Force
44+ }
3945
40- Compress-Archive - Path " $targetDir \*" - DestinationPath $zipPath - Force
46+ Compress-Archive - Path " $targetDir \*" - DestinationPath $zipPath - Force
4147
42- if (Test-Path $zipPath ) {
43- Write-Host " Archive created for $frameworkName "
44- } else {
45- Write-Warning " Failed to create archive for $frameworkName "
48+ if (Test-Path $zipPath ) {
49+ Write-Host " Archive created for $frameworkName ($config )"
50+ } else {
51+ Write-Warning " Failed to create archive for $frameworkName ($config )"
52+ }
4653 }
54+ } else {
55+ Write-Warning " Release directory not found for configuration '$config ': $releaseDir "
4756 }
48- } else {
49- Write-Warning " Release directory not found: $releaseDir "
5057}
0 commit comments