Publish Windows and Linux servers together
.NET port / test (macos-latest) (push) Canceled after 0s
.NET port / test (ubuntu-24.04) (push) Canceled after 0s
.NET port / test (windows-latest) (push) Canceled after 0s
.NET port / apple-client (push) Canceled after 0s

This commit is contained in:
2026-09-20 01:15:52 +02:00
parent b79cbeff44
commit 57a63cc1cd
10 changed files with 89 additions and 25 deletions
+14 -4
View File
@@ -1,7 +1,17 @@
[CmdletBinding(SupportsShouldProcess)]
param(
[string]$Runtime = 'win-x64',
[string]$Output = "$PSScriptRoot/artifacts/server/$Runtime"
[string[]]$Runtime = @('win-x64', 'linux-x64'),
[string]$Output
)
$ErrorActionPreference = 'Stop'
dotnet publish "$PSScriptRoot/src/VoiceCat.Server/VoiceCat.Server.csproj" -c Release -r $Runtime --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishTrimmed=false -p:RestoreLockedMode=true "-p:NuGetLockFilePath=packages.publish.$Runtime.lock.json" -o $Output
if ($LASTEXITCODE -ne 0) { throw 'Managed server publish failed.' }
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:RestoreLockedMode=true "-p:NuGetLockFilePath=packages.publish.$targetRuntime.lock.json" -o $targetOutput
if ($LASTEXITCODE -ne 0) { throw "Managed server publish failed for $targetRuntime." }
}