Skip to content

Commit 2459598

Browse files
committed
task: updated build scripts [skip ci]
1 parent 25c6f3e commit 2459598

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.assets/scripts/set-version-and-build.ps1

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ $solutionDir = Get-SolutionDirectory
1111
Set-Location $solutionDir
1212

1313
# Ensure GitVersion environment variables are set
14-
Ensure-GitVersion-Environment
14+
Ensure-GitVersion-Environment
1515

1616
# Build the project with the version information applied
1717
Build-Project -Configuration $BuildType
1818

19+
$solutionName = Split-Path $solutionDir -Leaf
20+
1921
# Output directory
20-
$releaseDir = Join-Path $solutionDir "src\$solutionDir\bin\Release"
22+
$releaseDir = Join-Path $solutionDir "src\$solutionName\bin\Release"
2123

2224
# Ensure release directory exists
2325
if (Test-Path $releaseDir) {
@@ -26,7 +28,7 @@ if (Test-Path $releaseDir) {
2628
$frameworkName = $_.Name
2729

2830
# Construct final archive name
29-
$zipFileName = "${solutionDir}-v${GitVersion_FullSemVer}-${frameworkName}-release.zip"
31+
$zipFileName = "${solutionName}-v$($Env:GitVersion_FullSemVer)-${frameworkName}-release.zip"
3032
$zipPath = Join-Path $releaseDir $zipFileName
3133

3234
Write-Host "Creating archive: $zipPath"
@@ -38,11 +40,11 @@ if (Test-Path $releaseDir) {
3840
Compress-Archive -Path "$targetDir\*" -DestinationPath $zipPath -Force
3941

4042
if (Test-Path $zipPath) {
41-
Write-Host "Archive created for $frameworkName"
43+
Write-Host "Archive created for $frameworkName"
4244
} else {
43-
Write-Warning "Failed to create archive for $frameworkName"
45+
Write-Warning "Failed to create archive for $frameworkName"
4446
}
4547
}
4648
} else {
47-
Write-Warning "Release directory not found: $releaseDir"
48-
}
49+
Write-Warning "Release directory not found: $releaseDir"
50+
}

0 commit comments

Comments
 (0)