From ab446b8162563daeb1cd8de35a8e03e44d407a8a Mon Sep 17 00:00:00 2001 From: semi Date: Wed, 31 Jul 2024 19:22:23 +0800 Subject: [PATCH] Merge commit '765fc2dbb63ff9ee581820812b97e899e9bf3d7f' --- .github/workflows/build_dart_sdk.yml | 112 +++++++++++++++++++++++---- Cargo.lock | 34 ++++++-- 2 files changed, 123 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build_dart_sdk.yml b/.github/workflows/build_dart_sdk.yml index e6ff611..745e935 100644 --- a/.github/workflows/build_dart_sdk.yml +++ b/.github/workflows/build_dart_sdk.yml @@ -18,21 +18,21 @@ jobs: - uses: actions/checkout@v4 - name: Compile run: | - cd bindings/dart/rust rustup set profile minimal rustup toolchain install stable rustup default stable rustup override set stable rustup target add --toolchain stable ${{ matrix.target }} - cargo build --release --target=${{ matrix.target }} - cd ../../../ + cargo build --package bindings_sdk --features="uniffi_plugin" --release --target=${{ matrix.target }} move target\${{ matrix.target }}\release\*.dll . - 7z a ${{ matrix.target }}.7z *.dll + move target\${{ matrix.target }}\release\*.lib . + 7z a ${{ matrix.target }}_runtime.7z *.dll + 7z a ${{ matrix.target }}_library.7z *.lib - name: Upload uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ matrix.target }}.7z + file: "*.7z" tag: ${{ github.ref }} overwrite: true file_glob: true @@ -49,21 +49,21 @@ jobs: - uses: actions/checkout@v4 - name: Compile run: | - cd bindings/dart/rust rustup set profile minimal rustup toolchain install stable rustup default stable rustup override set stable rustup target add --toolchain stable ${{ matrix.target }} - cargo build --release --target=${{ matrix.target }} - cd ../../../ + cargo build --package bindings_sdk --features="uniffi_plugin" --release --target=${{ matrix.target }} mv target/${{ matrix.target }}/release/*.dylib . - tar acf ${{ matrix.target }}.tar.xz *.dylib + mv target/${{ matrix.target }}/release/*.a . + tar acf ${{ matrix.target }}_runtime.tar.xz *.dylib + tar acf ${{ matrix.target }}_library.tar.xz *.a - name: Upload uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ matrix.target }}.tar.xz + file: "*.tar.xz" tag: ${{ github.ref }} overwrite: true file_glob: true @@ -82,22 +82,104 @@ jobs: - uses: actions/checkout@v4 - name: Compile run: | - cd bindings/dart/rust rustup set profile minimal rustup toolchain install stable rustup default stable rustup override set stable rustup target add --toolchain stable ${{ matrix.target }} cargo install cross --git https://github.com/cross-rs/cross - cross build --release --target=${{ matrix.target }} - cd ../../../ + cross build --package bindings_sdk --features="uniffi_plugin" --release --target=${{ matrix.target }} mv target/${{ matrix.target }}/release/*.so . - tar acf ${{ matrix.target }}.tar.xz *.so + mv target/${{ matrix.target }}/release/*.a . + tar acf ${{ matrix.target }}_runtime.tar.xz *.so + tar acf ${{ matrix.target }}_library.tar.xz *.a - name: Upload uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ matrix.target }}.tar.xz + file: "*.tar.xz" + tag: ${{ github.ref }} + overwrite: true + file_glob: true + build_wasm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Compile + run: | + curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + make build_wasm + mv bindings/wasm/*dist ./ + rm *dist/.gitignore + tar acf js_binding.tar.xz *dist + - name: Upload + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: "*.tar.xz" + tag: ${{ github.ref }} + overwrite: true + file_glob: true + python_binding: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Compile + run: | + make build_binding_files_python + mv bindings/generated/*.py ./ + tar acf python_binding.tar.xz zklink*.py + - name: Upload + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: "*.tar.xz" + tag: ${{ github.ref }} + overwrite: true + file_glob: true + go_binding: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: baptiste0928/cargo-install@v2 + with: + crate: uniffi-bindgen-go + git: https://github.com/NordSecurity/uniffi-bindgen-go + tag: "v0.2.1+v0.25.0" + cache-key: "uniffi-bindgen-go@v0.2.1+v0.25.0" + - name: Compile + run: | + make build_binding_files_go + mv bindings/generated/zklink_sdk ./ + tar acf go_binding.tar.xz zklink_sdk + - name: Upload + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: "*.tar.xz" + tag: ${{ github.ref }} + overwrite: true + file_glob: true + cpp_binding: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: baptiste0928/cargo-install@v2 + with: + crate: uniffi-bindgen-cpp + git: https://github.com/NordSecurity/uniffi-bindgen-cpp + tag: "v0.6.0+v0.25.0" + cache-key: "uniffi-bindgen-cpp@v0.6.0+v0.25.0" + - name: Compile + run: | + make build_binding_files_cpp + mv bindings/generated/zklink* ./ + tar acf cpp_binding.tar.xz zklink* + - name: Upload + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: "*.tar.xz" tag: ${{ github.ref }} overwrite: true file_glob: true diff --git a/Cargo.lock b/Cargo.lock index c9360d7..86bbff3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1307,9 +1307,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "derivative" @@ -3304,6 +3307,12 @@ dependencies = [ "serde", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.45" @@ -3771,6 +3780,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -5189,12 +5204,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -5202,16 +5219,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ]