- Fix LootTable.GuaranteedRolls type (int -> List<string>) to match JSON schema - Fix BoxEngine guaranteed rolls to iterate item IDs directly - Fix BoxEngine resource condition evaluation for "any" targetId - Make ItemDefinition.DescriptionKey optional - Fix font meta item nameKeys to use proper localization keys - Add 43 xUnit content validation tests (deserialization, cross-refs, localization) - Add self-contained single-file publish via publish.ps1 - Update README with distribute and test sections
53 lines
1.6 KiB
PowerShell
53 lines
1.6 KiB
PowerShell
<#
|
|
.SYNOPSIS
|
|
Builds a self-contained single-file executable for distribution.
|
|
.DESCRIPTION
|
|
Publishes Open The Box as a standalone .exe that includes the .NET runtime.
|
|
No .NET SDK or runtime installation needed on target machines.
|
|
.PARAMETER Runtime
|
|
Target runtime identifier. Default: win-x64
|
|
Examples: win-x64, win-arm64, linux-x64, osx-x64
|
|
#>
|
|
param(
|
|
[string]$Runtime = "win-x64"
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
Write-Host "=== Open The Box - Publish ===" -ForegroundColor Cyan
|
|
Write-Host "Runtime: $Runtime"
|
|
Write-Host ""
|
|
|
|
$OutputDir = Join-Path $PSScriptRoot "publish" $Runtime
|
|
|
|
# Clean previous publish
|
|
if (Test-Path $OutputDir) {
|
|
Remove-Item $OutputDir -Recurse -Force
|
|
}
|
|
|
|
Write-Host "Publishing self-contained single-file executable..." -ForegroundColor Yellow
|
|
|
|
dotnet publish src/OpenTheBox/OpenTheBox.csproj `
|
|
-c Release `
|
|
-r $Runtime `
|
|
--self-contained true `
|
|
-p:PublishSingleFile=true `
|
|
-p:IncludeNativeLibrariesForSelfExtract=true `
|
|
-o $OutputDir
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Host "Publish failed!" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
# Show output
|
|
Write-Host ""
|
|
Write-Host "Published to: $OutputDir" -ForegroundColor Green
|
|
$exe = Get-ChildItem $OutputDir -Filter "OpenTheBox*" | Where-Object { $_.Extension -in ".exe", "" } | Select-Object -First 1
|
|
if ($exe) {
|
|
$sizeMB = [math]::Round($exe.Length / 1MB, 1)
|
|
Write-Host "Executable: $($exe.Name) ($sizeMB MB)" -ForegroundColor Green
|
|
}
|
|
Write-Host ""
|
|
Write-Host "To distribute, copy the entire '$OutputDir' folder." -ForegroundColor Cyan
|
|
Write-Host "The content/ folder must remain alongside the executable." -ForegroundColor Cyan
|