From 769d82573a8585bb40d03ae04dcdb4ec03171abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Rom=C3=A1n=20N=C3=BA=C3=B1ez?= Date: Sat, 19 Sep 2026 21:40:15 +0000 Subject: [PATCH] Build Windows executable in shared Steam depot (#50) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - install the nightly Windows MSVC target and cargo-xwin in CI - build the production Windows executable alongside Linux - package both executables and only imported_assets in one Steam depot Reviewed-on: https://git.eirexe.moe/EIREXE/shinespark/pulls/50 Co-authored-by: Álex Román Núñez --- .gitea/workflows/ci.yml | 28 +++++++++++---- Cargo.lock | 78 ++++------------------------------------- Cargo.toml | 3 +- 3 files changed, 31 insertions(+), 78 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index f28aace..faef42e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -65,6 +65,11 @@ jobs: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" "$HOME/.cargo/bin/rustup" toolchain install nightly-2026-09-14 --profile minimal + - name: Install Windows build tooling + run: | + "$HOME/.cargo/bin/rustup" target add x86_64-pc-windows-msvc --toolchain nightly-2026-09-14 + "$HOME/.cargo/bin/cargo" install cargo-xwin --locked + - name: Cache production Rust dependencies and build artifacts uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: @@ -76,7 +81,7 @@ jobs: run: | sudo apt-get update sudo apt-get install --no-install-recommends -y \ - clang \ + clang-19 \ libasound2-dev \ libudev-dev \ libusb-1.0-0-dev \ @@ -84,9 +89,15 @@ jobs: libx11-dev \ libxkbcommon-dev \ libxkbcommon-x11-0 \ + lld-19 \ + llvm-19 \ mesa-vulkan-drivers \ mold \ pkg-config + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100 + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100 + echo "/usr/lib/llvm-19/bin" >> "$GITHUB_PATH" + rm -f "$HOME/.cache/cargo-xwin/clang-cl" - name: Preprocess assets run: cargo run --locked --bin process-assets --no-default-features --features debug_features -j 4 @@ -94,6 +105,11 @@ jobs: - name: Build production binary run: cargo build --locked --profile production --no-default-features --features debug_features -j 4 + - name: Build Windows production binary + run: | + clang --version + cargo xwin build --locked --target x86_64-pc-windows-msvc --profile production --no-default-features --features debug_features -j 4 --bin shinespark + - name: Verify production binary is not Bevy/Rust dynamically linked run: | ! readelf -d target/production/shinespark | grep -E 'libbevy_dylib|libstd-.*\.so' @@ -101,10 +117,10 @@ jobs: - name: Package Linux Steam depot if: github.event_name == 'push' && github.ref == 'refs/heads/master' run: | - mkdir -p build/linux - cp target/production/shinespark build/linux/shinespark - cp -R assets build/linux/assets - cp -R imported_assets build/linux/imported_assets + mkdir -p build/game + cp target/production/shinespark build/game/shinespark + cp target/x86_64-pc-windows-msvc/production/shinespark.exe build/game/shinespark.exe + cp -R imported_assets build/game/imported_assets - if: github.event_name == 'push' && github.ref == 'refs/heads/master' uses: CyberAndrii/steam-totp@v1 @@ -123,5 +139,5 @@ jobs: appId: 3409670 buildDescription: ${{ github.sha }} rootPath: build - depot1Path: linux + depot1Path: game releaseBranch: master diff --git a/Cargo.lock b/Cargo.lock index 00c62e8..b7b0f11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -94,12 +94,6 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" -[[package]] -name = "adler32" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" - [[package]] name = "ahash" version = "0.8.12" @@ -3208,16 +3202,6 @@ dependencies = [ "windows-sys 0.60.2", ] -[[package]] -name = "filetime" -version = "0.2.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759" -dependencies = [ - "cfg-if", - "libc", -] - [[package]] name = "find-msvc-tools" version = "0.1.9" @@ -3434,9 +3418,9 @@ dependencies = [ [[package]] name = "gc-adapter-neo" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120a5b3858ae854c4674ae41a38173e8ea04b814fb3212fd3bdd1b04d414a9d7" +checksum = "a8d3e10c6c4b928cb559f641765ebaa40f5f099bf51bc0227af7431859f8bd84" dependencies = [ "binread", "modular-bitfield", @@ -4266,26 +4250,6 @@ version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" -[[package]] -name = "libflate" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ff4ae71b685bbad2f2f391fe74f6b7659a34871c08b210fdc039e43bee07d18" -dependencies = [ - "adler32", - "crc32fast", - "libflate_lz77", -] - -[[package]] -name = "libflate_lz77" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a52d3a8bfc85f250440e4424db7d857e241a3aebbbe301f3eb606ab15c39acbf" -dependencies = [ - "rle-decode-fast", -] - [[package]] name = "libloading" version = "0.8.9" @@ -4326,15 +4290,13 @@ dependencies = [ [[package]] name = "libusb1-sys" -version = "0.4.4" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be241693102a24766d0b8526c8988771edac2842630d7e730f8e9fbc014f3703" +checksum = "da050ade7ac4ff1ba5379af847a10a10a8e284181e060105bf8d86960ce9ce0f" dependencies = [ "cc", "libc", - "libflate", "pkg-config", - "tar", "vcpkg", ] @@ -5840,12 +5802,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "rle-decode-fast" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" - [[package]] name = "robust" version = "1.2.0" @@ -5916,9 +5872,9 @@ dependencies = [ [[package]] name = "rusb" -version = "0.6.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f32cd45962594f9f8cd4547b5757132715600e2c8840aa9ccd3d1a9ed6fdc6" +checksum = "ab9f9ff05b63a786553a4c02943b74b34a988448671001e9a27e2f0565cc05a4" dependencies = [ "libc", "libusb1-sys", @@ -6126,6 +6082,7 @@ dependencies = [ "bevy_egui", "bevy_ggrs", "bincode", + "blake3", "clap", "enum_cycling", "enum_cycling_derive", @@ -6495,17 +6452,6 @@ dependencies = [ "slotmap", ] -[[package]] -name = "tar" -version = "0.4.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840" -dependencies = [ - "filetime", - "libc", - "xattr", -] - [[package]] name = "termcolor" version = "1.4.1" @@ -7911,16 +7857,6 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" -[[package]] -name = "xattr" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" -dependencies = [ - "libc", - "rustix 1.1.4", -] - [[package]] name = "xcursor" version = "0.3.11" diff --git a/Cargo.toml b/Cargo.toml index e77c261..f128cdb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ bevy = { version = "0.19", features = ["asset_processor", "basis-universal", "be # Loads the scenes you author in the editor (assets/*.bsn) and builds # physics colliders from them. An ordinary dependency; remove it if you # stop using authored scenes. +blake3 = { version = "1.8.5", features = [ "pure" ] } thiserror = "2" avian3d = "0.7" arrayvec = "0.7.8" @@ -33,7 +34,7 @@ strum = "0.28.0" strum_macros = "0.28.0" bevy_asset_loader = "0.27.0" ron_asset_manager = "0.9.0" -gc-adapter-neo = { version = "1.1.0", features = ["libusb"] } +gc-adapter-neo = { version = "1.1.1", features = ["libusb"] } rhai = "1.26.0" enum_cycling = "0.2.1" enum_cycling_derive = "0.2.1"