usearch 2.9.2 → 2.10.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.
Files changed (172) hide show
  1. package/README.md +39 -38
  2. package/javascript/{types → dist/cjs}/usearch.d.ts +90 -115
  3. package/javascript/dist/cjs/usearch.js +531 -0
  4. package/javascript/dist/esm/usearch.d.ts +212 -0
  5. package/javascript/{usearch.js → dist/esm/usearch.js} +199 -153
  6. package/package.json +25 -23
  7. package/prebuilds/darwin-arm64+x64/usearch.node +0 -0
  8. package/prebuilds/linux-arm64/usearch.node +0 -0
  9. package/prebuilds/linux-x64/usearch.node +0 -0
  10. package/prebuilds/win32-ia32/usearch.node +0 -0
  11. package/prebuilds/win32-x64/usearch.node +0 -0
  12. package/.clang-format +0 -10
  13. package/.clang-tidy +0 -60
  14. package/.cmake-format.py +0 -19
  15. package/.dockerignore +0 -93
  16. package/.gitattributes +0 -9
  17. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -90
  18. package/.github/ISSUE_TEMPLATE/config.yml +0 -5
  19. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -64
  20. package/.github/workflows/Dockerfile.libs +0 -36
  21. package/.github/workflows/prerelease.yml +0 -331
  22. package/.github/workflows/release.yml +0 -722
  23. package/.github/workflows/update_version.sh +0 -15
  24. package/.gitmodules +0 -9
  25. package/.releaserc +0 -90
  26. package/CITATION.cff +0 -11
  27. package/CMakeLists.txt +0 -324
  28. package/CODE_OF_CONDUCT.md +0 -128
  29. package/CONTRIBUTING.md +0 -361
  30. package/Cargo.toml +0 -19
  31. package/Dockerfile +0 -16
  32. package/VERSION +0 -1
  33. package/assets/unum.png +0 -0
  34. package/assets/usearch-approaches-transparent.png +0 -0
  35. package/assets/usearch-approaches-white.png +0 -0
  36. package/assets/usearch-neighbor-types.png +0 -0
  37. package/binding.gyp +0 -87
  38. package/build.gradle +0 -204
  39. package/build.rs +0 -18
  40. package/c/CMakeLists.txt +0 -25
  41. package/c/README.md +0 -34
  42. package/c/lib.cpp +0 -358
  43. package/c/test.c +0 -382
  44. package/c/usearch.h +0 -311
  45. package/cmake/clipp.cmake +0 -7
  46. package/cmake/config.cmake.in +0 -15
  47. package/cmake/emscripten.cmake +0 -8
  48. package/cmake/jemalloc.cmake +0 -62
  49. package/cmake/pkg-config.pc.in +0 -4
  50. package/cmake/usearchConfigVersion.cmake.in +0 -20
  51. package/conanfile.py +0 -26
  52. package/cpp/CMakeLists.txt +0 -14
  53. package/cpp/README.md +0 -161
  54. package/cpp/bench.cpp +0 -618
  55. package/cpp/test.cpp +0 -323
  56. package/fp16/CMakeLists.txt +0 -176
  57. package/fp16/LICENSE +0 -11
  58. package/fp16/README.md +0 -20
  59. package/fp16/bench/alt-element.cc +0 -89
  60. package/fp16/bench/from-alt-array.cc +0 -175
  61. package/fp16/bench/from-ieee-array.cc +0 -399
  62. package/fp16/bench/ieee-element.cc +0 -272
  63. package/fp16/bench/to-alt-array.cc +0 -91
  64. package/fp16/bench/to-ieee-array.cc +0 -303
  65. package/fp16/cmake/DownloadGoogleBenchmark.cmake +0 -15
  66. package/fp16/cmake/DownloadGoogleTest.cmake +0 -15
  67. package/fp16/cmake/DownloadPSimd.cmake +0 -15
  68. package/fp16/configure.py +0 -65
  69. package/fp16/confu.yaml +0 -8
  70. package/fp16/include/fp16/__init__.py +0 -0
  71. package/fp16/include/fp16/avx.py +0 -50
  72. package/fp16/include/fp16/avx2.py +0 -53
  73. package/fp16/include/fp16/bitcasts.h +0 -92
  74. package/fp16/include/fp16/fp16.h +0 -451
  75. package/fp16/include/fp16/psimd.h +0 -131
  76. package/fp16/include/fp16.h +0 -11
  77. package/fp16/jni/Android.mk +0 -6
  78. package/fp16/jni/Application.mk +0 -4
  79. package/fp16/test/alt-from-fp32-value.cc +0 -498
  80. package/fp16/test/alt-to-fp32-bits.cc +0 -263
  81. package/fp16/test/alt-to-fp32-psimd.cc +0 -145
  82. package/fp16/test/alt-to-fp32-value.cc +0 -348
  83. package/fp16/test/alt-to-fp32x2-psimd.cc +0 -245
  84. package/fp16/test/bitcasts.cc +0 -56
  85. package/fp16/test/ieee-from-fp32-value.cc +0 -523
  86. package/fp16/test/ieee-to-fp32-bits.cc +0 -333
  87. package/fp16/test/ieee-to-fp32-psimd.cc +0 -312
  88. package/fp16/test/ieee-to-fp32-value.cc +0 -420
  89. package/fp16/test/ieee-to-fp32x2-psimd.cc +0 -541
  90. package/fp16/test/peachpy/alt-xmm-to-fp32-xmm-avx.cc +0 -96
  91. package/fp16/test/peachpy/alt-xmm-to-fp32-ymm-avx2.cc +0 -96
  92. package/fp16/test/peachpy/stubs.py +0 -38
  93. package/fp16/test/tables.cc +0 -530
  94. package/fp16/test/tables.h +0 -13
  95. package/fp16/third-party/THHalf.h +0 -92
  96. package/fp16/third-party/eigen-half.h +0 -170
  97. package/fp16/third-party/float16-compressor.h +0 -80
  98. package/fp16/third-party/half.hpp +0 -2916
  99. package/fp16/third-party/npy-halffloat.h +0 -328
  100. package/include/usearch/index.hpp +0 -3836
  101. package/include/usearch/index_dense.hpp +0 -2004
  102. package/include/usearch/index_plugins.hpp +0 -2213
  103. package/javascript/lib.cpp +0 -341
  104. package/javascript/types/usearch.d.ts.map +0 -1
  105. package/javascript/usearch.test.js +0 -74
  106. package/package-ci.json +0 -10
  107. package/pyproject.toml +0 -51
  108. package/setup.py +0 -201
  109. package/simsimd/.releaserc +0 -86
  110. package/simsimd/CONTRIBUTING.md +0 -88
  111. package/simsimd/Cargo.lock +0 -709
  112. package/simsimd/Cargo.toml +0 -44
  113. package/simsimd/LICENSE +0 -201
  114. package/simsimd/README.md +0 -317
  115. package/simsimd/binding.gyp +0 -36
  116. package/simsimd/build.rs +0 -20
  117. package/simsimd/include/simsimd/binary.h +0 -245
  118. package/simsimd/include/simsimd/complex.h +0 -174
  119. package/simsimd/include/simsimd/probability.h +0 -548
  120. package/simsimd/include/simsimd/simsimd.h +0 -465
  121. package/simsimd/include/simsimd/spatial.h +0 -1267
  122. package/simsimd/include/simsimd/types.h +0 -208
  123. package/simsimd/javascript/bench.js +0 -127
  124. package/simsimd/javascript/fallback.ts +0 -193
  125. package/simsimd/javascript/lib.c +0 -102
  126. package/simsimd/javascript/node-gyp-build.d.ts +0 -1
  127. package/simsimd/javascript/simsimd.ts +0 -124
  128. package/simsimd/javascript/test.mjs +0 -153
  129. package/simsimd/javascript/tsconfig-base.json +0 -25
  130. package/simsimd/javascript/tsconfig-cjs.json +0 -8
  131. package/simsimd/javascript/tsconfig-esm.json +0 -8
  132. package/simsimd/package-lock.json +0 -1688
  133. package/simsimd/package.json +0 -61
  134. package/simsimd/rust/benches/cosine.rs +0 -27
  135. package/simsimd/rust/benches/native.rs +0 -30
  136. package/simsimd/rust/benches/sqeuclidean.rs +0 -27
  137. package/simsimd/rust/lib.c +0 -45
  138. package/simsimd/rust/lib.rs +0 -550
  139. package/sqlite/README.md +0 -178
  140. package/sqlite/lib.cpp +0 -325
  141. package/stringzilla/CONTRIBUTING.md +0 -446
  142. package/stringzilla/Cargo.lock +0 -25
  143. package/stringzilla/Cargo.toml +0 -26
  144. package/stringzilla/LICENSE +0 -201
  145. package/stringzilla/README.md +0 -1422
  146. package/stringzilla/VERSION +0 -1
  147. package/stringzilla/assets/cover-strinzilla.jpeg +0 -0
  148. package/stringzilla/assets/meme-stringzilla-v2.jpeg +0 -0
  149. package/stringzilla/assets/meme-stringzilla-v3.jpeg +0 -0
  150. package/stringzilla/binding.gyp +0 -16
  151. package/stringzilla/build.rs +0 -87
  152. package/stringzilla/c/lib.c +0 -337
  153. package/stringzilla/cli/README.md +0 -65
  154. package/stringzilla/cli/__init__.py +0 -0
  155. package/stringzilla/cli/split.py +0 -105
  156. package/stringzilla/cli/wc.py +0 -117
  157. package/stringzilla/include/stringzilla/experimental.h +0 -845
  158. package/stringzilla/include/stringzilla/module.modulemap +0 -9
  159. package/stringzilla/include/stringzilla/stringzilla.h +0 -5370
  160. package/stringzilla/include/stringzilla/stringzilla.hpp +0 -3838
  161. package/stringzilla/javascript/lib.c +0 -125
  162. package/stringzilla/javascript/stringzilla.js +0 -22
  163. package/stringzilla/package-ci.json +0 -10
  164. package/stringzilla/package.json +0 -32
  165. package/stringzilla/rust/lib.rs +0 -873
  166. package/stringzilla/swift/StringProtocol+StringZilla.swift +0 -280
  167. package/stringzilla/swift/Test.swift +0 -60
  168. package/tsconfig.json +0 -21
  169. package/wasmer.toml +0 -12
  170. package/winlibinstaller.bat +0 -42
  171. /package/{simsimd/javascript/dist-package-cjs.json → javascript/dist/cjs/package.json} +0 -0
  172. /package/{simsimd/javascript/dist-package-esm.json → javascript/dist/esm/package.json} +0 -0
@@ -1,722 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- branches: ["main"]
6
-
7
- env:
8
- BUILD_TYPE: Release
9
- GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
10
- PYTHONUTF8: 1
11
-
12
- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13
- permissions:
14
- contents: write
15
- pages: write
16
- id-token: write
17
- packages: write
18
-
19
- jobs:
20
- versioning:
21
- name: Semantic Release
22
- runs-on: ubuntu-22.04
23
- steps:
24
- - uses: actions/checkout@v3
25
- with:
26
- persist-credentials: false
27
- - name: Set up Node.js
28
- uses: actions/setup-node@v3
29
- with:
30
- node-version: 20
31
- - run: npm install --save-dev --prefix ./package-ci @semantic-release/exec @semantic-release/git conventional-changelog-eslint semantic-release && npx --prefix ./package-ci semantic-release
32
-
33
- rebase:
34
- name: Rebase Dev. Branch
35
- needs: versioning
36
- runs-on: ubuntu-22.04
37
- steps:
38
- - name: Checkout the latest code
39
- uses: actions/checkout@v3
40
- with:
41
- fetch-depth: 0
42
-
43
- - name: Perform rebase
44
- run: |
45
- git fetch origin main
46
- git checkout main-dev
47
- git rebase origin/main
48
-
49
- - name: Push changes
50
- uses: CasperWA/push-protected@v2
51
- with:
52
- token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
53
- branch: main-dev
54
- unprotect_reviews: True
55
- force: True
56
-
57
- create_linux_deb_package:
58
- name: Create Debian Package for ${{ matrix.arch }}
59
- runs-on: ubuntu-22.04
60
- needs: versioning
61
- strategy:
62
- fail-fast: false
63
- matrix:
64
- arch: ["linux/amd64", "linux/arm64"]
65
- steps:
66
- - uses: actions/checkout@v3
67
- with:
68
- persist-credentials: false
69
- ref: "main"
70
- - run: git submodule update --init --recursive
71
-
72
- - name: Setup QEMU
73
- uses: docker/setup-qemu-action@v2
74
-
75
- - name: Setup Docker
76
- uses: docker/setup-buildx-action@v2
77
-
78
- - name: Get Docker daemon IP
79
- id: dockerip
80
- run: |
81
- docker_ip=$(ip addr show docker0 | grep -Po 'inet \K[\d.]+') && \
82
- echo "docker_ip=$docker_ip" >> "$GITHUB_OUTPUT"
83
-
84
- - name: Set runner user password
85
- id: userpass
86
- run: |
87
- user_pass="1122"
88
- echo "runner:$user_pass" | sudo chpasswd
89
- echo "user_pass=$user_pass" >> "$GITHUB_OUTPUT"
90
-
91
- - name: Build library
92
- run: |
93
- docker buildx create --use
94
- docker buildx build \
95
- --platform ${{ matrix.arch }} \
96
- --build-arg docker_ip=${{ steps.dockerip.outputs.docker_ip }} \
97
- --build-arg user_pass=${{ steps.userpass.outputs.user_pass }} \
98
- --file .github/workflows/Dockerfile.libs \
99
- --tag unum/usearch-library:latest \
100
- --load .
101
- - name: Clear Docker buildx cache
102
- run: docker buildx prune --all --force
103
-
104
- - name: Upload archive
105
- uses: xresloader/upload-to-github-release@v1
106
- env:
107
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108
- with:
109
- file: "*.deb"
110
- update_latest_release: true
111
-
112
- create_windows_dll_library:
113
- name: Create Dll Library for Windows ${{ matrix.arch }}
114
- runs-on: windows-2022
115
- needs: versioning
116
- strategy:
117
- fail-fast: false
118
- matrix:
119
- arch: [x64, x86]
120
- steps:
121
- - uses: actions/checkout@v3
122
- with:
123
- persist-credentials: false
124
- ref: "main"
125
- - run: git submodule update --init --recursive
126
-
127
- - name: Setup CMake
128
- uses: jwlawson/actions-setup-cmake@v1.13
129
-
130
- - uses: actions/setup-go@v4
131
- with:
132
- go-version: "^1.19.0"
133
-
134
- - name: Setup MinGW
135
- uses: egor-tensin/setup-mingw@v2
136
- with:
137
- platform: ${{ matrix.arch }}
138
- version: 12.2.0
139
-
140
- - name: Get version
141
- id: set_version
142
- shell: bash
143
- run: |
144
- version=$(cat VERSION)
145
- echo "version=$version" >> $GITHUB_OUTPUT
146
-
147
- - name: Build library
148
- run: |
149
- cmake -DCMAKE_BUILD_TYPE=Release -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_BUILD_TEST_CPP=0 -DUSEARCH_BUILD_BENCH_CPP=0 -B ./build_release
150
- cmake --build ./build_release --config Release
151
- tar -cvf usearch_windows_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}.tar .\build_release\libusearch_c.dll .\c\usearch.h
152
-
153
- - name: Upload archive
154
- uses: xresloader/upload-to-github-release@v1
155
- env:
156
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157
- with:
158
- file: "usearch_windows_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}.tar"
159
- update_latest_release: true
160
-
161
- create_macos_library:
162
- name: Create Library for MacOS ${{ matrix.arch }}
163
- runs-on: macos-12
164
- needs: versioning
165
- strategy:
166
- fail-fast: false
167
- matrix:
168
- arch: [arm64, x86_64]
169
- steps:
170
- - uses: actions/checkout@v3
171
- with:
172
- persist-credentials: false
173
- ref: "main"
174
- - run: git submodule update --init --recursive
175
-
176
- - uses: actions/setup-go@v4
177
- with:
178
- go-version: "^1.21.0"
179
-
180
- - name: Get version
181
- id: version
182
- run: |
183
- version=$(cat VERSION)
184
- echo "version=$version" >> $GITHUB_OUTPUT
185
-
186
- - name: Build library
187
- run: |
188
- cmake -DCMAKE_BUILD_TYPE=Release -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_BUILD_TEST_CPP=0 -DUSEARCH_BUILD_BENCH_CPP=0 -B ./build_release
189
- cmake --build ./build_release --config Release
190
- zip -r usearch_macOS_${{ matrix.arch }}_${{ steps.version.outputs.version }}.zip build_release/libusearch_c.so c/usearch.h
191
-
192
- - name: Upload archive
193
- uses: xresloader/upload-to-github-release@v1
194
- env:
195
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
196
- with:
197
- file: "*.zip"
198
- update_latest_release: true
199
-
200
- wasm_c_library:
201
- name: WASM builds for C libraries on ${{ matrix.os }}
202
- runs-on: ${{ matrix.os }}
203
- needs: versioning
204
- strategy:
205
- fail-fast: false
206
- matrix:
207
- os: [ubuntu-22.04, macOS-11, windows-2022]
208
- steps:
209
- - uses: actions/checkout@v3
210
- with:
211
- persist-credentials: false
212
- ref: "main"
213
- - run: git submodule update --init --recursive
214
-
215
- - name: Get version
216
- id: version
217
- run: |
218
- version=$(cat VERSION)
219
- echo "version=$version" >> $GITHUB_OUTPUT
220
- shell: bash
221
-
222
- - name: Build library on Ubuntu
223
- run: |
224
- export WASI_VERSION=20
225
- export WASI_VERSION_FULL=${WASI_VERSION}.0
226
- wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
227
- tar xf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
228
- rm -rf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
229
- export WASI_SDK_PATH=/home/runner/work/usearch/usearch/wasi-sdk-${WASI_VERSION_FULL}
230
- archs=("x86_64" "arm64")
231
- cd ./c
232
- for arch in "${archs[@]}"
233
- do
234
- ../wasi-sdk-20.0/bin/clang++ --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot -o libusearch_c.so -O3 lib.cpp -I. -I ../include/ -I ../fp16/include/ -shared --target=wasm32-wasi-threads -Wl,--no-entry -nostdlib -D_WASI_EMULATED_MMAN -march="$arch"
235
- tar -czvf usearch_wasm_linux_"$arch"_${{ steps.version.outputs.version }}.tar.gz libusearch_c.so
236
- mv usearch_wasm_linux_"$arch"_${{ steps.version.outputs.version }}.tar.gz ../ && rm -rf libusearch_c.so
237
- done
238
- if: matrix.os == 'ubuntu-22.04'
239
-
240
- - name: Build library on MacOS
241
- run: |
242
- export WASI_VERSION=20
243
- export WASI_VERSION_FULL=${WASI_VERSION}.0
244
- wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-macos.tar.gz
245
- tar xf wasi-sdk-${WASI_VERSION_FULL}-macos.tar.gz
246
- rm -rf wasi-sdk-${WASI_VERSION_FULL}-macos.tar.gz
247
- export WASI_SDK_PATH=/Users/runner/work/usearch/usearch/wasi-sdk-${WASI_VERSION_FULL}
248
- archs=("x86_64" "arm64")
249
- cd ./c
250
- for arch in "${archs[@]}"
251
- do
252
- ../wasi-sdk-20.0/bin/clang++ --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot -o libusearch_c.so -O3 lib.cpp -I. -I ../include/ -I ../fp16/include/ -shared --target=wasm32-wasi-threads -Wl,--no-entry -nostdlib -D_WASI_EMULATED_MMAN -march="$arch"
253
- zip -r usearch_wasm_macos_"$arch"_${{ steps.version.outputs.version }}.zip libusearch_c.so
254
- mv usearch_wasm_macos_"$arch"_${{ steps.version.outputs.version }}.zip ../ && rm -rf libusearch_c.so
255
- done
256
- if: matrix.os == 'macOS-11'
257
-
258
- - name: Build library on Windows
259
- run: |
260
- export WASI_VERSION=20
261
- export WASI_VERSION_FULL=${WASI_VERSION}.0
262
- curl -LOJ https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}.m-mingw.tar.gz
263
- tar xf wasi-sdk-${WASI_VERSION_FULL}.m-mingw.tar.gz
264
- rm -rf wasi-sdk-${WASI_VERSION_FULL}.m-mingw.tar.gz
265
- export WASI_SDK_PATH=/d/a/usearch/usearch/wasi-sdk-${WASI_VERSION_FULL}+m
266
- archs=("x64" "x86")
267
- cd ./c
268
- for arch in "${archs[@]}"
269
- do
270
- ../wasi-sdk-20.0+m/bin/clang++ --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot -o libusearch_c.so -O3 lib.cpp -I. -I ../include/ -I ../fp16/include/ -shared --target=wasm32-wasi-threads -Wl,--no-entry -nostdlib -D_WASI_EMULATED_MMAN -march="$arch"
271
- tar -cvf usearch_wasm_windows_"$arch"_${{ steps.version.outputs.version }}.tar.gz libusearch_c.so
272
- mv usearch_wasm_windows_"$arch"_${{ steps.version.outputs.version }}.tar.gz ../ && rm -rf libusearch_c.so
273
- done
274
- shell: bash
275
- if: matrix.os == 'windows-2022'
276
-
277
- - name: Upload archive
278
- uses: xresloader/upload-to-github-release@v1
279
- env:
280
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
281
- with:
282
- file: "*.zip;*.tar.gz"
283
- update_latest_release: true
284
-
285
- publish_checksums:
286
- name: Compute Assets Checksums
287
- runs-on: ubuntu-22.04
288
- needs:
289
- [
290
- versioning,
291
- create_linux_deb_package,
292
- create_windows_dll_library,
293
- create_macos_library,
294
- wasm_c_library,
295
- deploy_docs_pages,
296
- ]
297
- steps:
298
- - name: Get last release ID
299
- id: last_release
300
- run: |
301
- response=$(curl -s -H "Authorization: Bearer ${{ secrets.SEMANTIC_RELEASE_TOKEN }}" \
302
- "https://api.github.com/repos/${{ github.repository }}/releases/latest")
303
- echo "last_release_id=$(echo "$response" | jq -r '.id')" >> $GITHUB_OUTPUT
304
-
305
- - uses: robinraju/release-downloader@v1.8
306
- name: Download release assets
307
- with:
308
- latest: true
309
- fileName: "*"
310
- out-file-path: "downloads"
311
- tarBall: true
312
- zipBall: true
313
-
314
- - name: Calculate source hashes
315
- id: hashes
316
- run: |
317
- i=1
318
- cd $GITHUB_WORKSPACE/downloads
319
- for asset_name in $(ls); do
320
- asset_hash=$(sha256sum $asset_name | awk '{print $1}')
321
- echo "asset_name_$i=$asset_name" >> $GITHUB_OUTPUT
322
- echo "asset_hash_$i=$asset_hash" >> $GITHUB_OUTPUT
323
- i=$((i+1))
324
- done
325
-
326
- - name: Upload hashes to release
327
- uses: irongut/EditRelease@v1.2.0
328
- with:
329
- token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
330
- id: ${{ steps.last_release.outputs.last_release_id }}
331
- prerelease: false
332
- replacebody: false
333
- body: |
334
- ## Hashes
335
- * ${{ steps.hashes.outputs.asset_name_1 }} : `${{ steps.hashes.outputs.asset_hash_1 }}`
336
- * ${{ steps.hashes.outputs.asset_name_2 }} : `${{ steps.hashes.outputs.asset_hash_2 }}`
337
- * ${{ steps.hashes.outputs.asset_name_3 }} : `${{ steps.hashes.outputs.asset_hash_3 }}`
338
- * ${{ steps.hashes.outputs.asset_name_4 }} : `${{ steps.hashes.outputs.asset_hash_4 }}`
339
- * ${{ steps.hashes.outputs.asset_name_5 }} : `${{ steps.hashes.outputs.asset_hash_5 }}`
340
- * ${{ steps.hashes.outputs.asset_name_6 }} : `${{ steps.hashes.outputs.asset_hash_6 }}`
341
- * ${{ steps.hashes.outputs.asset_name_7 }} : `${{ steps.hashes.outputs.asset_hash_7 }}`
342
- * ${{ steps.hashes.outputs.asset_name_8 }} : `${{ steps.hashes.outputs.asset_hash_8 }}`
343
- * ${{ steps.hashes.outputs.asset_name_9 }} : `${{ steps.hashes.outputs.asset_hash_9 }}`
344
- * ${{ steps.hashes.outputs.asset_name_10 }} : `${{ steps.hashes.outputs.asset_hash_10 }}`
345
- * ${{ steps.hashes.outputs.asset_name_11 }} : `${{ steps.hashes.outputs.asset_hash_11 }}`
346
- * ${{ steps.hashes.outputs.asset_name_12 }} : `${{ steps.hashes.outputs.asset_hash_12 }}`
347
- * ${{ steps.hashes.outputs.asset_name_13 }} : `${{ steps.hashes.outputs.asset_hash_13 }}`
348
- * ${{ steps.hashes.outputs.asset_name_14 }} : `${{ steps.hashes.outputs.asset_hash_14 }}`
349
- * ${{ steps.hashes.outputs.asset_name_15 }} : `${{ steps.hashes.outputs.asset_hash_15 }}`
350
-
351
- build_wheels:
352
- name: Build Python ${{ matrix.python-version }} for ${{ matrix.os }}
353
- runs-on: ${{ matrix.os }}
354
- needs: versioning
355
- strategy:
356
- matrix:
357
- os: [ubuntu-latest, macos-latest, windows-latest]
358
- python-version: ["37", "38", "39", "310", "311", "312"]
359
- steps:
360
- - uses: actions/checkout@v4
361
- with:
362
- ref: "main"
363
- - name: Set up Python
364
- uses: actions/setup-python@v5
365
- with:
366
- python-version: 3.x
367
- - name: Setup QEMU
368
- if: matrix.os == 'ubuntu-latest' # We only need QEMU for Linux builds
369
- uses: docker/setup-qemu-action@v3
370
- - name: Install cibuildwheel
371
- run: python -m pip install cibuildwheel
372
- - name: Build wheels
373
- run: cibuildwheel --output-dir wheelhouse
374
- env:
375
- CIBW_BUILD: cp${{ matrix.python-version }}-*
376
- - name: Upload wheels
377
- uses: actions/upload-artifact@v4
378
- with:
379
- name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
380
- path: ./wheelhouse/*.whl
381
- overwrite: true
382
-
383
- publish_python:
384
- name: Publish Python
385
- needs: build_wheels
386
- runs-on: ubuntu-22.04
387
- environment:
388
- name: pypi
389
- url: https://pypi.org/p/usearch
390
- permissions:
391
- id-token: write
392
-
393
- steps:
394
- - name: Download artifacts
395
- uses: actions/download-artifact@v4
396
- with:
397
- # unpacks all CIBW artifacts into dist/
398
- pattern: cibw-*
399
- path: dist
400
- merge-multiple: true
401
-
402
- - name: Publish to PyPi
403
- uses: pypa/gh-action-pypi-publish@release/v1
404
- with:
405
- packages-dir: dist
406
- verbose: true
407
- print-hash: true
408
-
409
- publish_javascript:
410
- name: Publish JavaScript
411
- needs: versioning
412
- runs-on: ubuntu-22.04
413
- env:
414
- CC: gcc-12
415
- CXX: g++-12
416
-
417
- steps:
418
- - uses: actions/checkout@v3
419
- with:
420
- ref: "main"
421
- - run: git submodule update --init --recursive
422
-
423
- - name: Update compilers
424
- run: |
425
- sudo apt update
426
- sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev gcc-12 g++-12
427
-
428
- - name: Set up Node.js
429
- uses: actions/setup-node@v3
430
- with:
431
- node-version: 20
432
-
433
- - name: Build and Test
434
- run: |
435
- npm ci
436
- npm test
437
- npm run typegen
438
-
439
- - name: Publish
440
- uses: JS-DevTools/npm-publish@v2
441
- with:
442
- token: ${{ secrets.NPM_TOKEN }}
443
-
444
- publish_rust:
445
- name: Publish Rust
446
- needs: versioning
447
- runs-on: ubuntu-22.04
448
- steps:
449
- - uses: actions/checkout@v3
450
- with:
451
- ref: "main"
452
- - run: git submodule update --init --recursive
453
- - uses: actions-rs/toolchain@v1
454
- with:
455
- toolchain: stable
456
- override: true
457
- - uses: katyo/publish-crates@v2
458
- with:
459
- registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
460
-
461
- publish_java:
462
- name: Publish Java
463
- needs: versioning
464
- runs-on: ubuntu-22.04
465
- permissions:
466
- contents: read
467
- packages: write
468
- env:
469
- MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
470
- MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
471
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
472
- ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
473
- ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
474
-
475
- steps:
476
- - uses: actions/checkout@v3
477
- with:
478
- ref: "main"
479
- - run: git submodule update --init --recursive
480
- - uses: actions/setup-java@v3
481
- with:
482
- java-version: "11"
483
- distribution: "adopt"
484
- - name: Setup Gradle
485
- uses: gradle/gradle-build-action@v2.4.2
486
- - name: Execute Gradle build
487
- run: gradle sign && gradle build
488
- - name: Publish package
489
- run: gradle publish
490
-
491
- publish_swift:
492
- name: Publish ObjC & Swift
493
- needs: versioning
494
- runs-on: macos-12
495
- steps:
496
- - uses: actions/checkout@v3
497
- with:
498
- ref: "main"
499
- - run: git submodule update --init --recursive
500
- - name: Build
501
- run: swift build
502
- - name: Run tests
503
- run: swift test
504
-
505
- # Publishes to both Docker Hub and GitHub Container Registry
506
- # https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-docker-hub-and-github-packages
507
- publish_docker:
508
- name: Publish Docker Image
509
- needs: versioning
510
- runs-on: ubuntu-22.04
511
- permissions:
512
- contents: read
513
- packages: write
514
- steps:
515
- - uses: actions/checkout@v3
516
- with:
517
- ref: "main"
518
- - run: git submodule update --init --recursive
519
- - name: Login to Docker Hub
520
- uses: docker/login-action@v2
521
- with:
522
- username: ${{ secrets.DOCKERHUB_USERNAME }}
523
- password: ${{ secrets.DOCKERHUB_TOKEN }}
524
- - name: Log in to GitHub Registry
525
- uses: docker/login-action@v2
526
- with:
527
- registry: ghcr.io
528
- username: ${{ github.actor }}
529
- password: ${{ secrets.GITHUB_TOKEN }}
530
- - name: Set up Docker Buildx
531
- uses: docker/setup-buildx-action@v2
532
- - name: Extract tags & labels for Docker
533
- id: meta
534
- uses: docker/metadata-action@v4
535
- with:
536
- images: |
537
- unum/usearch
538
- ghcr.io/${{ github.repository }}
539
- - name: Build and push
540
- uses: docker/build-push-action@v4
541
- with:
542
- context: .
543
- push: true
544
- tags: ${{ steps.meta.outputs.tags }}
545
- labels: ${{ steps.meta.outputs.labels }}
546
-
547
- build_csharp:
548
- name: Build C Dependencies for C#
549
- needs: versioning
550
- strategy:
551
- fail-fast: false
552
- matrix:
553
- os: [ubuntu-22.04, macos-12, windows-2022]
554
- runs-on: ${{ matrix.os }}
555
- defaults:
556
- run:
557
- shell: bash
558
-
559
- steps:
560
- - uses: actions/checkout@v3
561
- with:
562
- ref: "main"
563
- - run: git submodule update --init --recursive
564
-
565
- - name: Build C library for Linux
566
- if: matrix.os == 'ubuntu-22.04'
567
- run: |
568
- sudo apt update
569
- sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev gcc-12 g++-12
570
- export CC=gcc-12
571
- export CXX=g++-12
572
- cmake -B build_artifacts -DCMAKE_BUILD_TYPE=Release -DUSEARCH_BUILD_TEST_CPP=0 -DUSEARCH_BUILD_TEST_C=0 -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1
573
- cmake --build build_artifacts --config Release
574
- mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
575
- cp "${{ github.workspace }}/build_artifacts/libusearch_c.so" "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
576
-
577
- - name: Build C library for MacOS
578
- if: matrix.os == 'macos-12'
579
- run: |
580
- brew update
581
- brew install cmake
582
- cmake -B build_artifacts -DCMAKE_BUILD_TYPE=Release -DUSEARCH_BUILD_TEST_CPP=0 -DUSEARCH_BUILD_TEST_C=0 -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_USE_OPENMP=0 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=0
583
- cmake --build build_artifacts --config Release
584
- mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/osx-x64/native"
585
- cp "${{ github.workspace }}/build_artifacts/libusearch_c.dylib" "${{ github.workspace }}/csharp/lib/runtimes/osx-x64/native"
586
-
587
- - name: Build C library for Windows
588
- if: matrix.os == 'windows-2022'
589
- run: |
590
- choco install cmake
591
- cmake -B build_artifacts -DCMAKE_BUILD_TYPE=Release -DUSEARCH_BUILD_TEST_CPP=0 -DUSEARCH_BUILD_TEST_C=0 -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_USE_OPENMP=0 -DUSEARCH_USE_SIMSIMD=0 -DUSEARCH_USE_JEMALLOC=0
592
- cmake --build build_artifacts --config Release
593
- mkdir -p "${{ github.workspace }}\csharp\lib\runtimes\win-x64\native"
594
- cp "${{ github.workspace }}\build_artifacts\libusearch_c.dll" "${{ github.workspace }}\csharp\lib\runtimes\win-x64\native"
595
-
596
- - name: Upload Artifacts
597
- uses: actions/upload-artifact@v3
598
- with:
599
- name: usearch-csharp-dependencies
600
- path: ${{ github.workspace }}/csharp/lib/**/*
601
-
602
- publish_csharp:
603
- name: Publish C#
604
- runs-on: ubuntu-22.04
605
- needs: [build_csharp]
606
- env:
607
- SOLUTION: ${{ github.workspace }}/csharp
608
- USEARCH_LIBS: ${{ github.workspace }}/csharp/lib
609
- NUGET_PACKAGES: ${{ github.workspace }}/csharp/packages
610
- # NUGET_SOURCE: https://apiint.nugettest.org/v3/index.json
611
- NUGET_SOURCE: https://api.nuget.org/v3/index.json
612
- GITHUB_PACKAGES_SOURCE: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
613
- steps:
614
- - uses: actions/checkout@v3
615
- with:
616
- ref: "main"
617
- - run: git submodule update --init --recursive
618
-
619
- - name: Download usearch libs artifact
620
- uses: actions/download-artifact@v3
621
- with:
622
- name: usearch-csharp-dependencies
623
- path: ${{ env.USEARCH_LIBS }}
624
-
625
- - name: Setup .NET
626
- uses: actions/setup-dotnet@v3
627
- with:
628
- dotnet-version: 7.0.x
629
-
630
- - name: Pack project
631
- run: |
632
- dotnet pack "${{ env.SOLUTION }}" -c Release --output ${{ env.NUGET_PACKAGES }}
633
- working-directory: ${{ github.workspace }}
634
-
635
- - name: Publish to NuGet
636
- run: dotnet nuget push "${{ env.NUGET_PACKAGES }}/*.nupkg" --api-key "${{ secrets.NUGET_API }}" --source "${{ env.NUGET_SOURCE }}" --skip-duplicate
637
-
638
- - name: Prepare publish to GitHub Registry
639
- run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "${{ env.GITHUB_PACKAGES_SOURCE }}"
640
-
641
- - name: Publish to GitHub Registry
642
- run: dotnet nuget push "${{ env.NUGET_PACKAGES }}/*.nupkg" --api-key "${{ secrets.GITHUB_TOKEN }}" --source "github" --skip-duplicate
643
-
644
- build_docs:
645
- name: Build Docs
646
- runs-on: ubuntu-22.04
647
- if: ${{ always() }}
648
- needs:
649
- [
650
- publish_python,
651
- publish_javascript,
652
- publish_rust,
653
- publish_java,
654
- publish_swift,
655
- publish_docker,
656
- publish_csharp,
657
- ]
658
- permissions:
659
- contents: write
660
- steps:
661
- - name: Checkout
662
- uses: actions/checkout@v3
663
- with:
664
- ref: "main"
665
- - name: Install dependencies
666
- run: |
667
- sudo apt update &&
668
- sudo apt install -y doxygen graphviz dia git &&
669
- pip install sphinx==5.3.0 sphinx-js==3.2.1 breathe==4.35.0 furo==2023.3.27 m2r2==0.3.3.post2 sphinxcontrib-googleanalytics==0.2.dev20220708 sphinxcontrib-jquery==4.1 &&
670
- npm install -g jsdoc
671
- - name: Install USearch from PyPi
672
- run: pip install usearch
673
- - name: Build documentation
674
- run: cd docs && doxygen conf.dox && make html
675
- - name: Copy assets
676
- run: cp -r assets build/docs/html/
677
- - name: Compress assets
678
- run: tar -czvf docs.tar.gz build/docs/html/
679
- - name: Upload docs to release
680
- uses: xresloader/upload-to-github-release@v1
681
- env:
682
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
683
- with:
684
- file: docs.tar.gz
685
- update_latest_release: true
686
-
687
- deploy_docs_pages:
688
- name: Deploy GitHub Pages
689
- environment:
690
- name: github-pages
691
- url: ${{ steps.deployment.outputs.page_url }}
692
- runs-on: ubuntu-22.04
693
- if: ${{ always() }}
694
- needs: build_docs
695
- steps:
696
- - uses: robinraju/release-downloader@v1.8
697
- with:
698
- latest: true
699
- fileName: docs.tar.gz
700
- - name: Unpack docs
701
- run: tar -xf ./docs.tar.gz
702
- - name: Setup GitHub Pages
703
- uses: actions/configure-pages@v2
704
- - name: Upload artifacts
705
- uses: actions/upload-pages-artifact@v1
706
- with:
707
- path: ./build/docs/html
708
- - name: Deploy to GitHub Pages
709
- id: deployment
710
- uses: actions/deploy-pages@v1
711
-
712
- deploy_docs_vercel:
713
- name: Deploy Vercel
714
- runs-on: ubuntu-22.04
715
- if: ${{ always() }}
716
- needs: build_docs
717
- steps:
718
- - name: Notify Vercel
719
- uses: fjogeleit/http-request-action@v1
720
- with:
721
- url: ${{ secrets.DOCS_VERCEL }}
722
- method: "POST"