-
Notifications
You must be signed in to change notification settings - Fork 152
368 lines (364 loc) · 12.5 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
name: "Release"
on:
release:
types: [published]
permissions:
contents: read
jobs:
build-linux-x86_64-extension:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- run: ./scripts/vendor.sh
- run: make loadable static
- uses: actions/upload-artifact@v4
with:
name: sqlite-vec-linux-x86_64-extension
path: dist/*
build-macos-x86_64-extension:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- run: ./scripts/vendor.sh
- run: make loadable static
- uses: actions/upload-artifact@v4
with:
name: sqlite-vec-macos-x86_64-extension
path: dist/*
build-macos-aarch64-extension:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- run: ./scripts/vendor.sh
- run: make loadable static
- uses: actions/upload-artifact@v4
with:
name: sqlite-vec-macos-aarch64-extension
path: dist/*
build-windows-x86_64-extension:
runs-on: windows-2019
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: ./scripts/vendor.sh
shell: bash
- run: make sqlite-vec.h
- run: mkdir dist
- run: cl.exe /fPIC -shared /W4 /Ivendor/ /O2 /LD sqlite-vec.c -o dist/vec0.dll
- uses: actions/upload-artifact@v4
with:
name: sqlite-vec-windows-x86_64-extension
path: dist/*
build-linux-aarch64-extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get install gcc-arm-linux-gnueabihf
- run: ./scripts/vendor.sh
- run: make sqlite-vec.h
- run: make CC=arm-linux-gnueabihf-gcc loadable static
- uses: actions/upload-artifact@v4
with:
name: sqlite-vec-linux-aarch64-extension
path: dist/*
build-cosmopolitan:
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- run: |
mkdir $HOME/cosmo
curl -L -o cosmocc-$COSMO_VERSION.zip https://github.com/jart/cosmopolitan/releases/download/$COSMO_VERSION/cosmocc-$COSMO_VERSION.zip
unzip cosmocc-$COSMO_VERSION.zip -d $HOME/cosmo
env:
COSMO_VERSION: "3.5.4"
- run: ./scripts/vendor.sh
- run: make cli CC=$HOME/cosmo/bin/cosmocc AR=$HOME/cosmo/bin/cosmoar OMIT_SIMD=1
- run: tar -czvf sqlite-vec-$(cat VERSION)-cli-cosmopolitan.tar.gz dist/sqlite3
- run: gh release upload ${{ github.ref_name }} sqlite-vec-$(cat VERSION)-cli-cosmopolitan.tar.gz
env:
GH_TOKEN: ${{ github.token }}
- uses: actions/upload-artifact@v4
with:
name: sqlite-vec-cosmopolitan
path: dist/*
build-wasm32-emscripten:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mymindstorm/setup-emsdk@v12
with:
version: "latest"
- run: ./scripts/vendor.sh
- run: make sqlite-vec.h
- run: make wasm
- uses: actions/upload-artifact@v4
with:
name: sqlite-vec-wasm32-emscripten
path: dist/.wasm/*
include-hidden-files: true
build-android-extensions:
runs-on: ubuntu-latest
strategy:
matrix:
platforms:
[
{ name: android-aarch64, cc: aarch64-linux-android21-clang },
{ name: android-i686, cc: i686-linux-android21-clang },
{ name: android-x86_64, cc: x86_64-linux-android21-clang },
{ name: android-armv7a, cc: armv7a-linux-androideabi21-clang },
]
steps:
- uses: actions/checkout@v4
- run: ./scripts/vendor.sh
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- uses: android-actions/setup-android@v3
- run: |
sdkmanager --install "ndk;27.0.12077973"
echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/27.0.12077973" >> $GITHUB_ENV
- run: |
ls $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/
ls $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin
- run: |
export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
make CC=${{ matrix.platforms.cc }} \
AR=llvm-ar \
RANLIB=llvm-ranlib \
STRIP=llvm-strip loadable
- uses: actions/upload-artifact@v4
with:
name: sqlite-vec-${{ matrix.platforms.name }}-extension
path: dist/*.so
build-ios-extensions:
runs-on: ${{ matrix.platforms.runner }}
strategy:
fail-fast: false
matrix:
platforms: [
{
name: ios-aarch64,
target: arm64-apple-ios,
sdk: iphoneos,
runner: macos-14,
},
#{
# name: ios-x86_64,
# target: x86_64-apple-ios,
# sdk: iphoneos,
# runner: macos-12,
#},
{
name: iossimulator-aarch64,
target: arm64-apple-ios-simulator,
sdk: iphonesimulator,
runner: macos-14,
},
{
name: iossimulator-x86_64,
target: x86_64-apple-ios-simulator,
sdk: iphonesimulator,
runner: macos-14,
},
]
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- run: ./scripts/vendor.sh
- run: make CFLAGS="-target ${{ matrix.platforms.target }} -isysroot $(xcrun -sdk ${{ matrix.platforms.sdk }} --show-sdk-path) -fembed-bitcode -DNDEBUG=1" loadable static
- uses: actions/upload-artifact@v4
with:
name: sqlite-vec-${{ matrix.platforms.name }}-extension
path: dist/*
dist:
runs-on: ubuntu-latest
needs:
[
build-linux-x86_64-extension,
build-macos-x86_64-extension,
build-macos-aarch64-extension,
build-windows-x86_64-extension,
build-wasm32-emscripten,
build-android-extensions,
build-ios-extensions,
]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-linux-x86_64-extension
path: dist/linux-x86_64
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-linux-aarch64-extension
path: dist/linux-aarch64
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-macos-x86_64-extension
path: dist/macos-x86_64
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-macos-aarch64-extension
path: dist/macos-aarch64
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-windows-x86_64-extension
path: dist/windows-x86_64
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-wasm32-emscripten
path: dist/wasm32-emscripten
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-android-aarch64-extension
path: dist/android-aarch64
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-android-i686-extension
path: dist/android-i686
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-android-x86_64-extension
path: dist/android-x86_64
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-android-armv7a-extension
path: dist/android-armv7a
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-android-armv7a-extension
path: dist/android-armv7a
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-ios-aarch64-extension
path: dist/ios-aarch64
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-iossimulator-aarch64-extension
path: dist/iossimulator-aarch64
- uses: actions/download-artifact@v4
with:
name: sqlite-vec-iossimulator-x86_64-extension
path: dist/iossimulator-x86_64
- run: |
curl -L https://github.com/asg017/sqlite-dist/releases/download/v0.0.1-alpha.17/sqlite-dist-x86_64-unknown-linux-gnu.tar.xz \
| tar xfJ - --strip-components 1
- run: make sqlite-vec.h
- run: ./sqlite-dist ./sqlite-dist.toml --input dist/ --output distx/ --version $(cat VERSION)
- run: |
gh release upload ${{ github.ref_name }} \
distx/amalgamation/* \
distx/github_releases/* \
distx/spm/* \
distx/sqlpkg/* \
distx/checksums.txt \
distx/sqlite-dist-manifest.json \
distx/install.sh
env:
GH_TOKEN: ${{ github.token }}
- name: Install node
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"
- run: |
npm publish --access public distx/npm/sqlite-vec-darwin-arm64.tar.gz
npm publish --access public distx/npm/sqlite-vec-darwin-x64.tar.gz
npm publish --access public distx/npm/sqlite-vec-linux-x64.tar.gz
npm publish --access public distx/npm/sqlite-vec-windows-x64.tar.gz
npm publish --access public distx/npm/sqlite-vec-wasm-demo.tar.gz
npm publish --access public distx/npm/sqlite-vec.tar.gz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
- run: |
for file in distx/gem/*; do
gem push "$file"
done
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install twine
- run: |
twine upload distx/pip/*
twine upload distx/datasette/*
twine upload distx/sqlite_utils/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
upload-crate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: ./scripts/vendor.sh
- run: make sqlite-vec.h
- run: make deps
working-directory: ./bindings/rust
- run: cargo publish --no-verify
working-directory: ./bindings/rust
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
build-ncruces-go:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- run: make sqlite-vec.h
- uses: actions/checkout@v4
with:
repository: ncruces/go-sqlite3
path: go-sqlite3
- run: git apply ../bindings/go/ncruces/go-sqlite3.patch
working-directory: go-sqlite3/
- run: |
mkdir -p tools/
[ -d "tools/wasi-sdk" ] || curl -#L "$WASI_SDK" | tar xzC tools &
[ -d "tools/binaryen" ] || curl -#L "$BINARYEN" | tar xzC tools &
wait
mv "tools/wasi-sdk"* "tools/wasi-sdk"
mv "tools/binaryen"* "tools/binaryen"
sqlite3/download.sh
embed/build.sh
env:
WASI_SDK: "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-23/wasi-sdk-23.0-x86_64-linux.tar.gz"
BINARYEN: "https://github.com/WebAssembly/binaryen/releases/download/version_118/binaryen-version_118-x86_64-linux.tar.gz"
working-directory: go-sqlite3/
- uses: actions/checkout@v4
with:
repository: asg017/sqlite-vec-go-bindings
path: sqlite-vec-go-bindings
token: ${{secrets.NCRUCES_BINDINGS_REPO_PAT}}
- run: |
cp go-sqlite3/embed/sqlite3.wasm sqlite-vec-go-bindings/ncruces/sqlite3.wasm
cp sqlite-vec.c sqlite-vec-go-bindings/cgo/sqlite-vec.c
cp sqlite-vec.h sqlite-vec-go-bindings/cgo/sqlite-vec.h
- run: |
git config user.name "Alex Garcia"
git config user.email "alexsebastian.garcia@gmail.com"
git add .
git commit --allow-empty -m "AUTOMATED ${{ github.ref_name }}" || exit 0
git tag "${{ github.ref_name }}"
git push origin main "${{ github.ref_name }}"
working-directory: sqlite-vec-go-bindings
env:
GITHUB_TOKEN: ${{secrets.NCRUCES_BINDINGS_REPO_PAT}}