usearch 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -148,6 +148,25 @@ jobs:
148
148
  - name: Run tests
149
149
  run: swift test
150
150
 
151
+ test_wasm:
152
+ name: Test WASM
153
+ runs-on: ubuntu-latest
154
+ steps:
155
+ - uses: actions/checkout@v3
156
+ - run: git submodule update --init --recursive
157
+ - name: Prepare WASM Environment
158
+ run: |
159
+ sudo apt update &&
160
+ sudo apt install -y nodejs
161
+ git clone https://github.com/emscripten-core/emsdk.git
162
+ ./emsdk/emsdk install latest
163
+ - name: Build USearch by Emscripten
164
+ run: |
165
+ ./emsdk/emsdk activate latest && source ./emsdk/emsdk_env.sh
166
+ emcmake cmake -B ./build -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -s TOTAL_MEMORY=64MB" && emmake make -C ./build
167
+ - name: Run tests
168
+ run: node ./build/test.js
169
+
151
170
  build_docker:
152
171
  name: Test Docker Image
153
172
  runs-on: ubuntu-latest
@@ -270,6 +270,34 @@ jobs:
270
270
  push: true
271
271
  tags: ${{ steps.meta.outputs.tags }}
272
272
  labels: ${{ steps.meta.outputs.labels }}
273
+
274
+ build_publish_wasm:
275
+ name: WASM Build
276
+ runs-on: ubuntu-latest
277
+ steps:
278
+ - uses: actions/checkout@v3
279
+ - run: git submodule update --init --recursive
280
+
281
+ - name: Prepare WASM Environment
282
+ run: |
283
+ git clone https://github.com/emscripten-core/emsdk.git
284
+ ./emsdk/emsdk install latest
285
+
286
+ - name: Build USearch WASM by Emscripten
287
+ run: |
288
+ ./emsdk/emsdk activate latest && source ./emsdk/emsdk_env.sh
289
+ emcmake cmake -DUSEARCH_BUILD_TEST=0 -DUSEARCH_BUILD_BENCHMARK=0 -DUSEARCH_BUILD_WASM=1 -B ./build && emmake make -C ./build
290
+
291
+ - name: Install wasmer cli
292
+ run: |
293
+ curl https://get.wasmer.io -sSfL | sh
294
+ source ~/.wasmer/wasmer.sh
295
+
296
+ - name: Login Wasmer.io
297
+ run: wasmer login --token "${{ secrets.WASMER_TOKEN }}"
298
+
299
+ - name: Publish binary to Wasmer.io
300
+ run: wasmer publish
273
301
 
274
302
 
275
303
  build_docs:
@@ -9,4 +9,5 @@ echo $1 > VERSION &&
9
9
  sed -i "s/^\(#define USEARCH_VERSION_MINOR \).*/\1$(echo "$1" | cut -d. -f2)/" ./include/usearch/index.hpp &&
10
10
  sed -i "s/^\(#define USEARCH_VERSION_PATCH \).*/\1$(echo "$1" | cut -d. -f3)/" ./include/usearch/index.hpp &&
11
11
  sed -i "s/<version>[0-9]\+\.[0-9]\+\.[0-9]\+/<version>$1/" README.md &&
12
- sed -i "s/version = {0\.[0-9]\+\.[0-9]\+}/version = {$1}/" README.md
12
+ sed -i "s/version = {0\.[0-9]\+\.[0-9]\+}/version = {$1}/" README.md &&
13
+ sed -i "s/version=\".*\"/version=\"$1\"/" wasmer.toml
package/CMakeLists.txt CHANGED
@@ -118,3 +118,7 @@ endif()
118
118
  if(${USEARCH_BUILD_WOLFRAM})
119
119
  add_subdirectory(wolfram)
120
120
  endif()
121
+
122
+ if(${USEARCH_BUILD_WASM})
123
+ add_subdirectory(wasm)
124
+ endif()
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "usearch"
3
- version = "0.21.0"
3
+ version = "0.22.0"
4
4
  authors = ["Ashot Vardanian <1983160+ashvardanian@users.noreply.github.com>"]
5
5
  description = "Smaller & Faster Single-File Vector Search Engine from Unum"
6
6
  edition = "2021"