From bc656e2c5247618d566f356a76506bac7235aa93 Mon Sep 17 00:00:00 2001 From: ospab Date: Thu, 14 May 2026 22:49:17 +0300 Subject: [PATCH] CI/CD: Add -Flatten switch to build.ps1 to consolidate raw tagged binaries into dist/release/ --- scripts/build.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 5e6af7d..4547d05 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -1,4 +1,7 @@ # OSTP High-Performance Cross-Platform Build & Release Pipeline +param( + [switch]$Flatten # Consolidate raw uncompressed binaries with arch suffixes under dist/release/ +) $ProjectRoot = Split-Path -Parent $PSScriptRoot Push-Location $ProjectRoot @@ -77,6 +80,14 @@ foreach ($item in $WindowsTargets) { $ReleaseArchives += $archivePath Write-Output "✔ SUCCESSFULLY PACKAGED: $archiveName" + + if ($Flatten) { + $RawReleaseDir = Join-Path $DistDir "release" + New-Item -ItemType Directory -Force -Path $RawReleaseDir | Out-Null + $FlatName = "ostp-$arch.exe" + Copy-Item -Path $compiledBin -Destination (Join-Path $RawReleaseDir $FlatName) -Force + Write-Output " -> Flat copied: dist/release/$FlatName" + } } } else { Write-Output "⚠ FAILED compiling Windows $arch ($target). Missing local platform C++ toolchain components." @@ -135,6 +146,14 @@ if (Get-Command wsl -ErrorAction SilentlyContinue) { $ReleaseArchives += Join-Path $DistDir $archiveName Write-Output "✔ SUCCESSFULLY PACKAGED: $archiveName" + + if ($Flatten) { + $RawReleaseDir = Join-Path $DistDir "release" + New-Item -ItemType Directory -Force -Path $RawReleaseDir | Out-Null + $FlatName = "ostp-$arch" + Copy-Item -Path $compiledBin -Destination (Join-Path $RawReleaseDir $FlatName) -Force + Write-Output " -> Flat copied: dist/release/$FlatName" + } } } else { Write-Output "⚠ FAILED compiling Linux $arch ($target)."