@@ -250,6 +250,15 @@ jobs:
250250 build-sdist :
251251 name : Build Source Distribution
252252 runs-on : ubuntu-latest
253+ strategy :
254+ matrix :
255+ include :
256+ - target : x86_64-unknown-linux-gnu
257+ archive_ext : tar.gz
258+ - target : aarch64-apple-darwin
259+ archive_ext : tar.gz
260+ - target : x86_64-pc-windows-msvc
261+ archive_ext : zip
253262 steps :
254263 - name : Checkout repository
255264 uses : actions/checkout@v4
@@ -259,16 +268,81 @@ jobs:
259268 with :
260269 python-version : ' 3.12'
261270
271+ - name : Create directory structure
272+ run : |
273+ mkdir -p src/toondb/_bin/${{ matrix.target }}
274+ mkdir -p src/toondb/lib/${{ matrix.target }}
275+
276+ - name : Download binaries from main ToonDB release
277+ shell : bash
278+ run : |
279+ # Use toondb_version if provided, otherwise use version
280+ VERSION="${{ inputs.toondb_version }}"
281+ if [ -z "$VERSION" ]; then
282+ VERSION="${{ inputs.version }}"
283+ fi
284+
285+ TAG="v${VERSION}"
286+ TARGET="${{ matrix.target }}"
287+
288+ if [ "${{ matrix.archive_ext }}" = "zip" ]; then
289+ ASSET_NAME="toondb-${VERSION}-${TARGET}.zip"
290+ else
291+ ASSET_NAME="toondb-${VERSION}-${TARGET}.tar.gz"
292+ fi
293+
294+ DOWNLOAD_URL="https://github.com/${{ env.TOONDB_REPO }}/releases/download/${TAG}/${ASSET_NAME}"
295+ echo "Downloading ToonDB binaries for sdist:"
296+ echo " URL: $DOWNLOAD_URL"
297+
298+ curl -L -f -o release-archive.${{ matrix.archive_ext }} "$DOWNLOAD_URL"
299+
300+ # Extract the archive
301+ if [ "${{ matrix.archive_ext }}" = "zip" ]; then
302+ unzip -o release-archive.zip
303+ else
304+ tar -xzf release-archive.tar.gz
305+ fi
306+
307+ - name : Copy binaries to SDK
308+ shell : bash
309+ run : |
310+ TARGET="${{ matrix.target }}"
311+
312+ # Copy binaries
313+ if [ "$TARGET" = "x86_64-pc-windows-msvc" ]; then
314+ # Windows binaries
315+ find . -maxdepth 2 -name "toondb-bulk.exe" -type f -exec cp {} src/toondb/_bin/${TARGET}/ \;
316+ find . -maxdepth 2 -name "toondb-grpc-server.exe" -type f -exec cp {} src/toondb/_bin/${TARGET}/ \;
317+ find . -maxdepth 2 -name "toondb_storage.dll" -type f -exec cp {} src/toondb/lib/${TARGET}/ \;
318+ find . -maxdepth 2 -name "toondb_index.dll" -type f -exec cp {} src/toondb/lib/${TARGET}/ \;
319+ else
320+ # Unix binaries
321+ find . -maxdepth 2 -name "toondb-bulk" -type f -exec cp {} src/toondb/_bin/${TARGET}/ \;
322+ find . -maxdepth 2 -name "toondb-server" -type f -exec cp {} src/toondb/_bin/${TARGET}/ \; || true
323+ find . -maxdepth 2 -name "toondb-grpc-server" -type f -exec cp {} src/toondb/_bin/${TARGET}/ \;
324+ find . -maxdepth 2 -name "libtoondb_storage*" -type f -exec cp {} src/toondb/lib/${TARGET}/ \;
325+ find . -maxdepth 2 -name "libtoondb_index*" -type f -exec cp {} src/toondb/lib/${TARGET}/ \;
326+ chmod +x src/toondb/_bin/${TARGET}/* 2>/dev/null || true
327+ fi
328+
329+ echo "=== Binaries for ${TARGET} ==="
330+ ls -la src/toondb/_bin/${TARGET}/ 2>/dev/null || echo "No binaries"
331+ echo "=== Libraries for ${TARGET} ==="
332+ ls -la src/toondb/lib/${TARGET}/ 2>/dev/null || echo "No libraries"
333+
262334 - name : Update package version
263335 run : |
264336 sed -i 's/version = ".*"/version = "${{ inputs.version }}"/' pyproject.toml
265337
266- - name : Build sdist
338+ - name : Build sdist (only first target)
339+ if : matrix.target == 'x86_64-unknown-linux-gnu'
267340 run : |
268341 pip install build
269342 python -m build --sdist
270343
271344 - name : Upload sdist artifact
345+ if : matrix.target == 'x86_64-unknown-linux-gnu'
272346 uses : actions/upload-artifact@v4
273347 with :
274348 name : sdist
0 commit comments