From 9197938e59246d354e4674760df24f99031a386e Mon Sep 17 00:00:00 2001 From: Luo Zhihao Date: Sat, 3 Jan 2026 23:43:26 +0800 Subject: [PATCH 1/2] Remove prebuilt wasm in repo and add it to .gitignore The wasm is built and released by CI --- .gitattributes | 1 - .github/workflows/ci.yml | 34 +++++++++++++----- .../workflows/{ci_full.yml => ci_minimal.yml} | 36 ++++++------------- crates/basisu_sys/.gitignore | 2 ++ crates/basisu_sys/Cargo.toml | 2 +- crates/basisu_sys/wasm/.gitkeep | 0 crates/basisu_sys/wasm/basisu_vendor.js | 3 -- crates/basisu_sys/wasm/basisu_vendor.wasm | 3 -- 8 files changed, 38 insertions(+), 43 deletions(-) rename .github/workflows/{ci_full.yml => ci_minimal.yml} (52%) create mode 100644 crates/basisu_sys/.gitignore create mode 100644 crates/basisu_sys/wasm/.gitkeep delete mode 100644 crates/basisu_sys/wasm/basisu_vendor.js delete mode 100755 crates/basisu_sys/wasm/basisu_vendor.wasm diff --git a/.gitattributes b/.gitattributes index 94c80e0..a65c2f6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,4 +2,3 @@ *.basisu_ktx2 filter=lfs diff=lfs merge=lfs -text vendor/basis_universal/**/* filter=lfs diff=lfs merge=lfs -text *.wasm filter=lfs diff=lfs merge=lfs -text -crates/basisu_sys/wasm/* filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c912e2..b3f3bc9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,28 +13,44 @@ concurrency: env: CARGO_TERM_COLOR: always + EM_VERSION: 4.0.22 jobs: - build-macos-windows: - name: Build ${{matrix.os}} - runs-on: ${{matrix.os}} - strategy: - fail-fast: false - matrix: - os: [macos-latest, windows-latest] - + build-linux-wasm: + name: Build linux,wasm + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: lfs: true + - name: Install Linux dependencies + uses: ./.github/actions/install-linux-deps + - name: Install rust toolchain uses: dtolnay/rust-toolchain@master with: toolchain: stable + targets: wasm32-unknown-unknown + + - name: Install Emscripten + uses: mymindstorm/setup-emsdk@v14 + with: + version: ${{ env.EM_VERSION }} + + - name: Install wasm-opt + run: wget https://github.com/WebAssembly/binaryen/releases/download/version_125/binaryen-version_125-x86_64-linux.tar.gz && tar -xvf binaryen-version_125-x86_64-linux.tar.gz && sudo cp binaryen-version_125/bin/wasm-opt /usr/local/bin/ && rm -r binaryen-version_125 && rm binaryen-version_125-x86_64-linux.tar.gz - name: Clippy - run: cargo clippy -- -D warnings + run: cargo clippy --workspace --all-targets --all-features -- -D warnings - name: Build run: cargo build --verbose + + - name: Build basisu vendor wasm + run: cargo r -p bevy_basisu_loader_sys --bin build-wasm-cli --features build-wasm-cli -- --emcc-flags="-Os -flto=full" --wasm-opt-flags="-Os" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + path: crates/basisu_sys/wasm/ diff --git a/.github/workflows/ci_full.yml b/.github/workflows/ci_minimal.yml similarity index 52% rename from .github/workflows/ci_full.yml rename to .github/workflows/ci_minimal.yml index 557a71d..dd8b736 100644 --- a/.github/workflows/ci_full.yml +++ b/.github/workflows/ci_minimal.yml @@ -1,4 +1,4 @@ -name: Rust CI Full +name: Rust CI Minimal on: workflow_dispatch: @@ -13,49 +13,33 @@ concurrency: env: CARGO_TERM_COLOR: always - EM_VERSION: 4.0.22 ANDROID_NDK_VERSION: 28.1.13356709 jobs: - build-linux-wasm: - name: Build linux,wasm - runs-on: ubuntu-latest + build-macos-windows: + name: Build ${{matrix.os}} + runs-on: ${{matrix.os}} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest] + steps: - uses: actions/checkout@v4 with: lfs: true - - name: Install Linux dependencies - uses: ./.github/actions/install-linux-deps - - name: Install rust toolchain uses: dtolnay/rust-toolchain@master with: toolchain: stable - targets: wasm32-unknown-unknown - - - name: Install Emscripten - uses: mymindstorm/setup-emsdk@v14 - with: - version: ${{ env.EM_VERSION }} - - - name: Install wasm-opt - run: wget https://github.com/WebAssembly/binaryen/releases/download/version_125/binaryen-version_125-x86_64-linux.tar.gz && tar -xvf binaryen-version_125-x86_64-linux.tar.gz && sudo cp binaryen-version_125/bin/wasm-opt /usr/local/bin/ && rm -r binaryen-version_125 && rm binaryen-version_125-x86_64-linux.tar.gz - name: Clippy - run: cargo clippy --workspace --all-targets --all-features -- -D warnings + run: cargo clippy -- -D warnings - name: Build run: cargo build --verbose - - name: Build basisu vendor wasm - run: cargo r -p bevy_basisu_loader_sys --bin build-wasm-cli --features build-wasm-cli -- --emcc-flags="-Os -flto=full" --wasm-opt-flags="-Os" - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - path: crates/basisu_sys/wasm/ - build-android: name: Build android runs-on: ubuntu-latest diff --git a/crates/basisu_sys/.gitignore b/crates/basisu_sys/.gitignore new file mode 100644 index 0000000..783b490 --- /dev/null +++ b/crates/basisu_sys/.gitignore @@ -0,0 +1,2 @@ +wasm/*.js +wasm/*.wasm diff --git a/crates/basisu_sys/Cargo.toml b/crates/basisu_sys/Cargo.toml index 3906c41..e6debd0 100644 --- a/crates/basisu_sys/Cargo.toml +++ b/crates/basisu_sys/Cargo.toml @@ -6,7 +6,7 @@ repository.workspace = true license.workspace = true description = "A rust wrapper around the Basis Universal transcoder library" keywords = ["basis", "universal", "ffi", "transcoder"] -exclude = ["src/bin/build_wasm_cli.rs"] +include = ["vendor/", "wasm/", "src/*.rs"] [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"] diff --git a/crates/basisu_sys/wasm/.gitkeep b/crates/basisu_sys/wasm/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/crates/basisu_sys/wasm/basisu_vendor.js b/crates/basisu_sys/wasm/basisu_vendor.js deleted file mode 100644 index db75c4b..0000000 --- a/crates/basisu_sys/wasm/basisu_vendor.js +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c89d06319e37edc5b8a737328e5818958e82cdc6a0e7a92e60fd79feeefbb372 -size 10378 diff --git a/crates/basisu_sys/wasm/basisu_vendor.wasm b/crates/basisu_sys/wasm/basisu_vendor.wasm deleted file mode 100755 index 7b67c85..0000000 --- a/crates/basisu_sys/wasm/basisu_vendor.wasm +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b377e8fd04c91d4089e529c762815690d4396c22ef3ad288c53acbbcde6dd0dc -size 377252 From 6ac417f2c9123ca571f15a869571965c23e0e2ce Mon Sep 17 00:00:00 2001 From: Luo Zhihao Date: Sat, 3 Jan 2026 23:51:09 +0800 Subject: [PATCH 2/2] Release v0.2.0 --- Cargo.toml | 4 ++-- README.md | 4 ++-- crates/basisu_sys/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f67a10c..4bd6746 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_basisu_loader" -version = "0.1.7" +version = "0.2.0" edition = "2024" repository.workspace = true license.workspace = true @@ -22,7 +22,7 @@ bevy = { version = "0.17", default-features = false, features = [ serde = { version = "1", features = ["derive"] } thiserror = { version = "2", default-features = false } log = { version = "0.4", default-features = false } -bevy_basisu_loader_sys = { version = "0.1", path = "crates/basisu_sys" } +bevy_basisu_loader_sys = { version = "0.2", path = "crates/basisu_sys" } [workspace] members = ["crates/*", "examples/test_scene"] diff --git a/README.md b/README.md index 37e6538..eeb19cf 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Web demo: https://beicause.github.io/bevy_basisu_loader/ 1. Add the Cargo dependency: ```toml -bevy_basisu_loader = "0.1" +bevy_basisu_loader = "0.2" ``` 2. Add `BasisuLoaderPlugin`: @@ -67,7 +67,7 @@ cargo r -p bevy_basisu_loader_sys --bin build-wasm-cli --features build-wasm-cli | `bevy` | `bevy_basisu_loader` | | ------ | -------------------- | -| 0.17 | 0.1 | +| 0.17 | 0.1, 0.2 | ## License diff --git a/crates/basisu_sys/Cargo.toml b/crates/basisu_sys/Cargo.toml index e6debd0..d35240d 100644 --- a/crates/basisu_sys/Cargo.toml +++ b/crates/basisu_sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_basisu_loader_sys" -version = "0.1.7" +version = "0.2.0" edition = "2024" repository.workspace = true license.workspace = true