Files
voice-cat/scripts/publish-server.ps1
Talon 6de95ddaa1
Build and test / test (macos-latest) (push) Canceled after 0s
Build and test / test (ubuntu-24.04) (push) Canceled after 0s
Build and test / test (windows-latest) (push) Canceled after 0s
Build and test / apple-client (push) Canceled after 0s
Regenerate runtime publish locks
2026-09-21 02:12:03 +02:00

18 lines
1.0 KiB
PowerShell

[CmdletBinding(SupportsShouldProcess)]
param(
[string[]]$Runtime = @('win-x64', 'linux-x64'),
[string]$Output
)
$ErrorActionPreference = 'Stop'
if ($Runtime.Count -eq 0) { throw 'At least one runtime must be specified.' }
if ($Output -and $Runtime.Count -ne 1) { throw '-Output can only be used when publishing one runtime.' }
foreach ($targetRuntime in $Runtime) {
$targetOutput = if ($Output) { $Output } else { "$PSScriptRoot/../artifacts/server/$targetRuntime" }
if (-not $PSCmdlet.ShouldProcess($targetOutput, "Publish VoiceCat.Server for $targetRuntime")) { continue }
dotnet publish "$PSScriptRoot/../src/VoiceCat.Server/VoiceCat.Server.csproj" -c Release -r $targetRuntime --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishTrimmed=false -p:RestorePackagesWithLockFile=true -p:RestoreLockedMode=false "-p:NuGetLockFilePath=obj/packages.publish.$targetRuntime.lock.json" -o $targetOutput
if ($LASTEXITCODE -ne 0) { throw "Managed server publish failed for $targetRuntime." }
}