From ea275210cd5933dca63e816405fe1af6553edfe6 Mon Sep 17 00:00:00 2001 From: Nomads_Reach <144523850+NomadsReach@users.noreply.github.com> Date: Sun, 16 Aug 2026 18:47:14 -0400 Subject: [PATCH] Restyle the Avalonia server host and add a single-file publish workflow (#18) Give the host a cohesive vault-terminal look: header wordmark with a live status pill that glows green while running, sectioned configuration card with per-field labels, a terminal-style server log, richer player rows (id, name, address, packet counts), and a bold Start/Stop control bar. All existing bindings are unchanged. Add publish-host.yml to build self-contained, single-file win-x64 and linux-x64 binaries on the self-hosted runner and upload them as artifacts, and document the untrimmed publish commands in the host README. --- .github/workflows/publish-host.yml | 51 ++++++ host/App.axaml | 202 ++++++++++++++++++++++- host/README.md | 16 +- host/Views/MainWindow.axaml | 250 ++++++++++++++++++++--------- 4 files changed, 437 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/publish-host.yml diff --git a/.github/workflows/publish-host.yml b/.github/workflows/publish-host.yml new file mode 100644 index 0000000..cce5438 --- /dev/null +++ b/.github/workflows/publish-host.yml @@ -0,0 +1,51 @@ +name: Publish Host (Avalonia) + +# Produces self-contained, single-file Server Host binaries for Windows and +# Linux. No .NET runtime is required on the target machine. Runs on demand and +# on version tags; each build is uploaded as a workflow artifact. + +on: + workflow_dispatch: + push: + tags: + - "host-v*" + +jobs: + publish: + name: Publish ${{ matrix.rid }} + runs-on: [self-hosted, Linux, X64] + strategy: + fail-fast: false + matrix: + rid: [win-x64, linux-x64] + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-dotnet@v4 + # The runner user cannot write to system /usr/share/dotnet; install the + # pinned SDK into a runner-writable, cached path instead. + env: + DOTNET_INSTALL_DIR: ${{ runner.tool_cache }}/dotnet + with: + dotnet-version: "8.0.x" + + - name: Publish single-file self-contained + # Untrimmed on purpose: the host uses reflection-based Avalonia bindings, + # which the trimmer would strip. + run: > + dotnet publish host/CommonwealthOnline.Host.csproj + -c Release + -r ${{ matrix.rid }} + --self-contained true + -p:PublishSingleFile=true + -p:IncludeNativeLibrariesForSelfExtract=true + -p:DebugType=none + -o out/${{ matrix.rid }} + --nologo + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: CommonwealthOnline.Host-${{ matrix.rid }} + path: out/${{ matrix.rid }}/ + if-no-files-found: error diff --git a/host/App.axaml b/host/App.axaml index 3ca1064..0483e48 100644 --- a/host/App.axaml +++ b/host/App.axaml @@ -3,23 +3,211 @@ x:Class="CommonwealthOnline.Host.App" RequestedThemeVariant="Dark"> - - - - - #0E120B - #171C10 + + + #0A0E07 + #12180C + #151B0F + #1C2314 + #232C18 + #2C3720 + #43532F #E6D28C + #F6ECBE #D8D2BE - #C24B4B + #8A9068 + #8BD05C + #3E5C28 + #C85450 + #5A2A28 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/host/README.md b/host/README.md index 1968935..0d289c6 100644 --- a/host/README.md +++ b/host/README.md @@ -25,7 +25,19 @@ server — a published `CommonwealthOnline.Server` executable, the framework ## Publish +Self-contained, single-file builds that need no .NET runtime on the target. +The host uses reflection-based Avalonia bindings, so publish **untrimmed**. + ``` -dotnet publish host/CommonwealthOnline.Host.csproj -c Release -r win-x64 --self-contained false -dotnet publish host/CommonwealthOnline.Host.csproj -c Release -r linux-x64 --self-contained false +dotnet publish host/CommonwealthOnline.Host.csproj -c Release -r win-x64 \ + --self-contained true -p:PublishSingleFile=true \ + -p:IncludeNativeLibrariesForSelfExtract=true -o out/win-x64 + +dotnet publish host/CommonwealthOnline.Host.csproj -c Release -r linux-x64 \ + --self-contained true -p:PublishSingleFile=true \ + -p:IncludeNativeLibrariesForSelfExtract=true -o out/linux-x64 ``` + +CI builds both runtimes and uploads them as artifacts — run the +**Publish Host (Avalonia)** workflow (`.github/workflows/publish-host.yml`) +manually, or push a `host-v*` tag. diff --git a/host/Views/MainWindow.axaml b/host/Views/MainWindow.axaml index 810293b..46d1fe3 100644 --- a/host/Views/MainWindow.axaml +++ b/host/Views/MainWindow.axaml @@ -3,102 +3,206 @@ xmlns:vm="clr-namespace:CommonwealthOnline.Host.ViewModels" x:Class="CommonwealthOnline.Host.Views.MainWindow" x:DataType="vm:MainWindowViewModel" - Width="960" Height="700" - MinWidth="820" MinHeight="600" + Width="1040" Height="740" + MinWidth="900" MinHeight="640" Title="Commonwealth Online — Server Host" - Background="{StaticResource CoBackgroundBrush}"> + Background="{StaticResource CoWindowBrush}"> - + - + + + - + + + + + + + - - - - - - - - - - - - - - -