[CmdletBinding()] param([Parameter(Mandatory=$true)][string]$Executable) $ErrorActionPreference = 'Stop' $repo = Split-Path -Parent $PSScriptRoot $Executable = (Resolve-Path -LiteralPath $Executable).Path $stamp = Get-Date -Format yyyyMMdd-HHmmss $release = Join-Path $repo "Tools/output/server_release/AIServer-Windows-x64-$stamp" New-Item -ItemType Directory -Path $release -Force | Out-Null Copy-Item -LiteralPath $Executable -Destination (Join-Path $release 'aiserver.exe') Get-ChildItem -LiteralPath (Join-Path $repo 'AIServer/deploy/windows') -File | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $release } $manifest = @{ platform='windows-x64'; runtime='static MSVC /MT'; generatedUtc=[DateTime]::UtcNow.ToString('o') executableSha256=(Get-FileHash -LiteralPath $Executable -Algorithm SHA256).Hash gameplayConfigSha256=(Get-FileHash -LiteralPath (Join-Path $repo 'Config/Gameplay/greenfield.json') -Algorithm SHA256).Hash skillConfigSha256=(Get-FileHash -LiteralPath (Join-Path $repo 'Config/Combat/skill_runtime_v1.json') -Algorithm SHA256).Hash containsDatabase=$false; defaultPort=15888; bindAddress='127.0.0.1' } [IO.File]::WriteAllText((Join-Path $release 'release.json'),($manifest | ConvertTo-Json), (New-Object Text.UTF8Encoding($false))) $zip = "$release.zip" Compress-Archive -LiteralPath (Get-ChildItem -LiteralPath $release -File | Select-Object -ExpandProperty FullName) -DestinationPath $zip Write-Output $zip