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