diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e919d66..9178bd7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,18 +19,16 @@ jobs: # permissions: # contents: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # rust compiler for creating binaries - name: Install latest nightly (for wasm) - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly - target: wasm32-unknown-unknown + targets: wasm32-unknown-unknown components: rustfmt, clippy - override: true - - name: Install wasm target + - name: Install Wasm Target run: | set -e rustup target add wasm32-unknown-unknown @@ -38,16 +36,14 @@ jobs: # Runs some Rust-related caching - uses: Swatinem/rust-cache@v2 - - name: Install wasm-pack - uses: actions-rs/cargo@v1 - with: - command: install - args: --target-dir ./target/wasm/ wasm-pack - + - name: Download wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + + # wasm-pack build --release also optimizes the wasm binary - name: Build Release wasm run: wasm-pack build --release --target web --no-default-features --features "wasm_yew_ui" - - name: Prepare Wasm deploy + - name: Prepare Wasm Deploy run: | set -e # Prepare the publishing structure diff --git a/Cargo.lock b/Cargo.lock index 60c6c96..2f1a7e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1243,7 +1243,7 @@ checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hf-hub" version = "0.3.2" -source = "git+https://github.com/swfsql/hf-hub.git?rev=8c3865841d8ce0b3538972a17c05aa0301283a8d#8c3865841d8ce0b3538972a17c05aa0301283a8d" +source = "git+https://github.com/swfsql/hf-hub.git?rev=fcaade15a9a844c4cde1145d1f40388ae2be998f#fcaade15a9a844c4cde1145d1f40388ae2be998f" dependencies = [ "bytes", "dirs", diff --git a/Cargo.toml b/Cargo.toml index ef60a0c..61149b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,21 +42,18 @@ tokenizers = { version = "0.13.4", default-features = false, features = [ "unstable_wasm", ] } -# Note: requires esaxx-rs which requires clang - # non-wasm target [target.'cfg(not(target_arch = "wasm32"))'.dependencies.hf-hub] version = "0.3.2" # path = "../hf-hub" git = "https://github.com/swfsql/hf-hub.git" -rev = "8c3865841d8ce0b3538972a17c05aa0301283a8d" +rev = "fcaade15a9a844c4cde1145d1f40388ae2be998f" default-features = false features = ["online"] # wasm target -# TODO: some dependencies are optional (ui-related ones) [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1.6" reqwest = { version = "0.11.23", features = ["json"] } @@ -74,6 +71,6 @@ yew = { version = "0.21.0", features = ["csr"] } version = "0.3.2" # path = "../hf-hub" git = "https://github.com/swfsql/hf-hub.git" -rev = "8c3865841d8ce0b3538972a17c05aa0301283a8d" +rev = "fcaade15a9a844c4cde1145d1f40388ae2be998f" default-features = false features = ["wasm"]