Add Windows publish script
This commit is contained in:
parent
e4c5df165d
commit
edfc0e9f7b
2 changed files with 98 additions and 0 deletions
11
README.md
11
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`.
|
||||
|
|
|
|||
87
scripts/publish-win-x64.ps1
Normal file
87
scripts/publish-win-x64.ps1
Normal file
|
|
@ -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"
|
||||
Loading…
Reference in a new issue