|
|
@@ -4,19 +4,27 @@ $ErrorActionPreference = "Stop"
|
|
|
$repoRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
|
$windowsDir = Join-Path $repoRoot "windows"
|
|
|
$serverDir = Join-Path $repoRoot "server"
|
|
|
-$windowsSolution = Join-Path $windowsDir "NetworkTool.Client.sln"
|
|
|
+$windowsProject = Join-Path $windowsDir "NetworkTool.Client\NetworkTool.Client.csproj"
|
|
|
+$windowsPublishOutput = Join-Path $repoRoot "publish\win-x64"
|
|
|
$serverLinuxOutput = Join-Path $serverDir "networktool-server-linux-amd64"
|
|
|
|
|
|
-if (-not (Test-Path -LiteralPath $windowsSolution)) {
|
|
|
- throw "Windows solution not found: $windowsSolution"
|
|
|
+if (-not (Test-Path -LiteralPath $windowsProject)) {
|
|
|
+ throw "Windows project not found: $windowsProject"
|
|
|
}
|
|
|
|
|
|
if (-not (Test-Path -LiteralPath $serverDir)) {
|
|
|
throw "Server directory not found: $serverDir"
|
|
|
}
|
|
|
|
|
|
-Write-Host "[1/2] Building Windows client (Debug)..."
|
|
|
-dotnet build $windowsSolution -c Debug
|
|
|
+Write-Host "[1/2] Publishing Windows client (Release, self-contained win-x64)..."
|
|
|
+dotnet publish $windowsProject `
|
|
|
+ -c Release `
|
|
|
+ -r win-x64 `
|
|
|
+ --self-contained true `
|
|
|
+ -p:PublishSingleFile=true `
|
|
|
+ -p:IncludeNativeLibrariesForSelfExtract=true `
|
|
|
+ -p:EnableCompressionInSingleFile=true `
|
|
|
+ -o $windowsPublishOutput
|
|
|
|
|
|
$previousGoos = $env:GOOS
|
|
|
$previousGoarch = $env:GOARCH
|
|
|
@@ -38,5 +46,5 @@ finally {
|
|
|
}
|
|
|
|
|
|
Write-Host "Build completed."
|
|
|
-Write-Host "Windows client output: windows/NetworkTool.Client/bin/Debug/net9.0-windows/"
|
|
|
+Write-Host "Windows client output: publish/win-x64/"
|
|
|
Write-Host "Server Linux output: server/networktool-server-linux-amd64"
|