From 0c3d6c57e1cca65a55b1040eaecda068669307b6 Mon Sep 17 00:00:00 2001 From: Steve Biedermann Date: Sun, 18 Oct 2026 20:08:45 +0200 Subject: [PATCH] ci: package Windows builds with cargo xtask pack The Windows workflows now ship the dedicated server alongside the client and publish the archive produced by xtask instead of packaging by hand. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .gitea/workflows/windows-client.yml | 24 ++++++++---------------- .github/workflows/windows-client.yml | 26 ++++++-------------------- 2 files changed, 14 insertions(+), 36 deletions(-) diff --git a/.gitea/workflows/windows-client.yml b/.gitea/workflows/windows-client.yml index 3c87463..76de9e6 100644 --- a/.gitea/workflows/windows-client.yml +++ b/.gitea/workflows/windows-client.yml @@ -1,6 +1,6 @@ -# Gitea Actions: cross-compiles the Windows client on a Linux runner with MinGW, +# Gitea Actions: cross-compiles the Windows client and server on a Linux runner with MinGW, # since most Gitea runners are Linux containers. -name: Windows client +name: Windows package on: push: @@ -16,7 +16,7 @@ env: jobs: build: - name: Build Windows client + name: Build Windows package runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -25,7 +25,7 @@ jobs: run: | SUDO=$(command -v sudo || true) $SUDO apt-get update - $SUDO apt-get install -y --no-install-recommends gcc-mingw-w64-x86-64 zip + $SUDO apt-get install -y --no-install-recommends gcc-mingw-w64-x86-64 - name: Install Rust uses: dtolnay/rust-toolchain@stable @@ -42,28 +42,20 @@ jobs: key: windows-gnu-${{ hashFiles('Cargo.lock') }} restore-keys: windows-gnu- - - name: Build - run: cargo build --release --locked -p game_client --bin game --target "$TARGET" - - - name: Package - run: | - dist=dist/station-windows - mkdir -p "$dist" - cp "target/$TARGET/release/game.exe" "$dist/" - cp -r assets README.md "$dist/" - (cd dist && zip -qr station-windows.zip station-windows) + - name: Pack client and server + run: cargo xtask pack --target "$TARGET" # Gitea does not support upload-artifact v4. - name: Upload artifact uses: actions/upload-artifact@v3 with: name: station-windows - path: dist/station-windows + path: dist/station-*/ if-no-files-found: error - name: Publish release if: startsWith(github.ref, 'refs/tags/v') uses: https://gitea.com/actions/release-action@main with: - files: dist/station-windows.zip + files: dist/station-*.zip api_key: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/windows-client.yml b/.github/workflows/windows-client.yml index fe145b6..687b22f 100644 --- a/.github/workflows/windows-client.yml +++ b/.github/workflows/windows-client.yml @@ -1,4 +1,4 @@ -name: Windows client +name: Windows package on: push: @@ -17,7 +17,7 @@ env: jobs: build: - name: Build Windows client + name: Build Windows package runs-on: windows-latest permissions: contents: write @@ -30,32 +30,18 @@ jobs: - name: Cache cargo uses: Swatinem/rust-cache@v2 - - name: Build - run: cargo build --release --locked -p game_client --bin game - - - name: Package - shell: pwsh - run: | - $dist = "dist/station-windows" - New-Item -ItemType Directory -Force -Path $dist | Out-Null - Copy-Item target/release/game.exe $dist/ - Copy-Item -Recurse assets $dist/assets - Copy-Item README.md $dist/ + - name: Pack client and server + run: cargo xtask pack --target x86_64-pc-windows-msvc - name: Upload artifact uses: actions/upload-artifact@v4 with: name: station-windows - path: dist/station-windows + path: dist/station-*/ if-no-files-found: error - - name: Create release archive - if: startsWith(github.ref, 'refs/tags/v') - shell: pwsh - run: Compress-Archive -Path dist/station-windows/* -DestinationPath dist/station-windows.zip - - name: Publish release if: startsWith(github.ref, 'refs/tags/v') uses: softprops/action-gh-release@v2 with: - files: dist/station-windows.zip + files: dist/station-*.zip