From edfc0e9f7b90d16b3ad4b0764498ae4a68b09084 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 8 May 2026 19:41:30 +0100 Subject: [PATCH] Add Windows publish script --- README.md | 11 +++++ scripts/publish-win-x64.ps1 | 87 +++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 scripts/publish-win-x64.ps1 diff --git a/README.md b/README.md index 73b72b7..b24f5c5 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,17 @@ Headless watch smoke: .\scripts\dev-watch.ps1 -Headless ``` +Shipping publish: + +```powershell +.\scripts\publish-win-x64.ps1 -Clean -Zip +``` + +This writes a self-contained Windows build to +`artifacts\publish\win-x64`, verifies the executable, live runtime DLL, +contracts DLL, icon, bundled fonts, and shader source, then optionally creates +`artifacts\publish\EpiphanyAquariumEngine-win-x64.zip`. + The first cut opens a Win32 window directly and owns a D3D11 swapchain through Vortice. No Stride runtime, no asset protocol, no borrowed game loop wearing a fake mustache. See `docs/vortice-spine.md`. diff --git a/scripts/publish-win-x64.ps1 b/scripts/publish-win-x64.ps1 new file mode 100644 index 0000000..ddbfe8e --- /dev/null +++ b/scripts/publish-win-x64.ps1 @@ -0,0 +1,87 @@ +param( + [switch]$Zip, + [switch]$NoSelfContained, + [switch]$Clean, + [string]$Configuration = "Release", + [string]$Runtime = "win-x64", + [string]$OutputRoot +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +$repoRoot = Resolve-Path (Join-Path $PSScriptRoot "..") +$projectPath = Join-Path $repoRoot "src\Aquarium.Engine\Aquarium.Engine.csproj" +$liveProjectPath = Join-Path $repoRoot "src\Aquarium.Engine.Live\Aquarium.Engine.Live.csproj" +$publishRoot = if ([string]::IsNullOrWhiteSpace($OutputRoot)) { + Join-Path $repoRoot "artifacts\publish" +} +else { + $OutputRoot +} +$publishPath = Join-Path $publishRoot $Runtime +$zipPath = Join-Path $publishRoot "EpiphanyAquariumEngine-$Runtime.zip" + +if ($Clean -and (Test-Path $publishPath)) { + Remove-Item -LiteralPath $publishPath -Recurse -Force +} + +New-Item -ItemType Directory -Force -Path $publishPath | Out-Null + +$selfContained = if ($NoSelfContained) { "false" } else { "true" } +$publishArguments = @( + "publish", + $projectPath, + "-c", $Configuration, + "-r", $Runtime, + "--self-contained", $selfContained, + "-o", $publishPath, + "/p:UseAppHost=true" +) + +Write-Host "Publishing Aquarium Engine:" +Write-Host " Project: $projectPath" +Write-Host " Live: $liveProjectPath" +Write-Host " Runtime: $Runtime" +Write-Host " Output: $publishPath" +dotnet @publishArguments +if ($LASTEXITCODE -ne 0) { + throw "dotnet publish failed with exit code $LASTEXITCODE." +} + +dotnet publish $liveProjectPath -c $Configuration -r $Runtime --self-contained false -o $publishPath +if ($LASTEXITCODE -ne 0) { + throw "live runtime publish failed with exit code $LASTEXITCODE." +} + +$requiredFiles = @( + "Aquarium.Engine.exe", + "Aquarium.Engine.Live.dll", + "Aquarium.Engine.Contracts.dll", + "Assets\Aquarium-Engine-Icon.ico", + "Assets\Fonts\Montserrat[wght].ttf", + "Assets\Fonts\UbuntuSans[wdth,wght].ttf", + "Render\Shaders\Aquarium.hlsl" +) + +foreach ($relativePath in $requiredFiles) { + $path = Join-Path $publishPath $relativePath + if (-not (Test-Path -LiteralPath $path)) { + throw "Publish output is missing required file: $relativePath" + } +} + +Write-Host "Publish output verified." + +if ($Zip) { + if (Test-Path $zipPath) { + Remove-Item -LiteralPath $zipPath -Force + } + + Compress-Archive -Path (Join-Path $publishPath "*") -DestinationPath $zipPath -CompressionLevel Optimal + Write-Host "Zip ready:" + Write-Host " $zipPath" +} + +Write-Host "Shipping build ready:" +Write-Host " $publishPath"