usearch 0.21.0 → 0.22.1

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,13 +270,44 @@ jobs:
270
270
  push: true
271
271
  tags: ${{ steps.meta.outputs.tags }}
272
272
  labels: ${{ steps.meta.outputs.labels }}
273
+
274
+ publish_wasm:
275
+ name: WASM Build
276
+ needs: versioning
277
+ runs-on: ubuntu-latest
278
+ permissions:
279
+ contents: read
280
+ packages: write
281
+
282
+ steps:
283
+ - uses: actions/checkout@v3
284
+ with:
285
+ ref: 'main'
286
+ - run: git submodule update --init --recursive
287
+
288
+ - name: Prepare WASM Environment
289
+ run: |
290
+ git clone https://github.com/emscripten-core/emsdk.git
291
+ ./emsdk/emsdk install latest
292
+
293
+ - name: Build USearch WASM by Emscripten
294
+ run: |
295
+ ./emsdk/emsdk activate latest && source ./emsdk/emsdk_env.sh
296
+ emcmake cmake -DUSEARCH_BUILD_TEST=0 -DUSEARCH_BUILD_BENCHMARK=0 -DUSEARCH_BUILD_WASM=1 -B ./build && emmake make -C ./build
297
+
298
+ - name: Trigger Wasmer.io CLI
299
+ run: |
300
+ curl https://get.wasmer.io -sSfL | sh
301
+ source ~/.wasmer/wasmer.sh
302
+ wasmer login --token "${{ secrets.WASMER_TOKEN }}"
303
+ wasmer publish
273
304
 
274
305
 
275
306
  build_docs:
276
307
  name: Build Docs
277
308
  runs-on: ubuntu-22.04
278
309
  if: ${{ always() }}
279
- needs: [publish_python, publish_javascript, publish_rust, publish_java, publish_swift, publish_docker]
310
+ needs: [publish_python, publish_javascript, publish_rust, publish_java, publish_swift, publish_docker, publish_wasm]
280
311
  permissions:
281
312
  contents: write
282
313
  steps:
@@ -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.1"
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"