Skip to content

fix: loosen rusqlite version pin to >=0.31 for downstream compatibility #28

fix: loosen rusqlite version pin to >=0.31 for downstream compatibility

fix: loosen rusqlite version pin to >=0.31 for downstream compatibility #28

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact: graphqlite.so
artifact-name: graphqlite-linux-x86_64.so
rust-lib-name: graphqlite-linux-x86_64.so
cli-artifact: gqlite
cli-artifact-name: gqlite-linux-x86_64
- os: ubuntu-24.04-arm
artifact: graphqlite.so
artifact-name: graphqlite-linux-aarch64.so
rust-lib-name: graphqlite-linux-aarch64.so
cli-artifact: gqlite
cli-artifact-name: gqlite-linux-aarch64
- os: macos-14
arch: arm64
artifact: graphqlite.dylib
artifact-name: graphqlite-macos-arm64.dylib
rust-lib-name: graphqlite-macos-aarch64.dylib
cli-artifact: gqlite
cli-artifact-name: gqlite-macos-arm64
- os: macos-14
arch: x86_64
artifact: graphqlite.dylib
artifact-name: graphqlite-macos-x86_64.dylib
rust-lib-name: graphqlite-macos-x86_64.dylib
cli-artifact: gqlite
cli-artifact-name: gqlite-macos-x86_64
- os: windows-latest
artifact: graphqlite.dll
artifact-name: graphqlite-windows-x86_64.dll
rust-lib-name: graphqlite-windows-x86_64.dll
cli-artifact: gqlite.exe
cli-artifact-name: gqlite-windows-x86_64.exe
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
steps:
- uses: actions/checkout@v4
- name: Setup MSYS2 (Windows)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-sqlite3
mingw-w64-x86_64-libsystre
bison
flex
make
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y bison flex libsqlite3-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install bison flex sqlite
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
echo "HOMEBREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
echo "SQLITE_PREFIX=$(brew --prefix sqlite)" >> $GITHUB_ENV
- name: Build extension (Linux)
if: runner.os == 'Linux'
run: make extension RELEASE=1
- name: Build extension (macOS arm64)
if: runner.os == 'macOS' && matrix.arch == 'arm64'
run: make extension RELEASE=1
- name: Build extension (macOS x86_64 cross-compile)
if: runner.os == 'macOS' && matrix.arch == 'x86_64'
run: make extension RELEASE=1 CC="clang -arch x86_64"
- name: Build extension (Windows)
if: runner.os == 'Windows'
run: make extension RELEASE=1
# Build gqlite CLI
- name: Install static SQLite (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install -y libsqlite3-dev
- name: Build gqlite CLI (Linux)
if: runner.os == 'Linux'
run: make gqlite-portable RELEASE=1
- name: Build gqlite CLI (macOS arm64)
if: runner.os == 'macOS' && matrix.arch == 'arm64'
run: make gqlite-portable RELEASE=1
- name: Build gqlite CLI (macOS x86_64 cross-compile)
if: runner.os == 'macOS' && matrix.arch == 'x86_64'
run: make gqlite-portable RELEASE=1 CC="clang -arch x86_64"
- name: Build gqlite CLI (Windows)
if: runner.os == 'Windows'
run: make gqlite-portable RELEASE=1
# Python binding tests
- name: Set up Python (Linux/Windows)
if: runner.os != 'macOS'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install and test Python bindings (Linux)
if: runner.os == 'Linux'
run: |
pip install -e "./bindings/python[dev]"
cd bindings/python && pytest tests/ -v
- name: Install and test Python bindings (macOS)
if: runner.os == 'macOS' && matrix.arch == 'arm64'
run: |
# Use Homebrew Python which supports extension loading
brew install python@3.11
$(brew --prefix python@3.11)/libexec/bin/python -m pip install -e "./bindings/python[dev]"
DYLD_LIBRARY_PATH="$SQLITE_PREFIX/lib:$DYLD_LIBRARY_PATH" $(brew --prefix python@3.11)/libexec/bin/python -m pytest bindings/python/tests/ -v
- name: Install and test Python bindings (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
pip install -e "./bindings/python[dev]"
cd bindings/python && pytest tests/ -v
# Rust binding tests (skip for cross-compiled x86_64)
- name: Install Rust toolchain
if: matrix.arch != 'x86_64'
uses: dtolnay/rust-toolchain@stable
- name: Copy extension to Rust libs
if: matrix.arch != 'x86_64'
shell: bash
run: |
mkdir -p bindings/rust/libs
cp build/${{ matrix.artifact }} bindings/rust/libs/${{ matrix.rust-lib-name }}
- name: Test Rust bindings
if: matrix.arch != 'x86_64'
working-directory: bindings/rust
shell: bash
run: cargo test -- --test-threads=1
- name: Rename extension artifact
run: cp build/${{ matrix.artifact }} build/${{ matrix.artifact-name }}
- name: Rename CLI artifact
run: cp build/${{ matrix.cli-artifact }} build/${{ matrix.cli-artifact-name }}
shell: bash
- name: Upload extension artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: build/${{ matrix.artifact-name }}
- name: Upload CLI artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.cli-artifact-name }}
path: build/${{ matrix.cli-artifact-name }}
# Build platform-specific Python wheels
build-wheels:
needs: build-and-test
strategy:
matrix:
include:
- os: ubuntu-latest
artifact: graphqlite-linux-x86_64.so
extension: graphqlite.so
wheel_tag: manylinux_2_17_x86_64.manylinux2014_x86_64
- os: ubuntu-24.04-arm
artifact: graphqlite-linux-aarch64.so
extension: graphqlite.so
wheel_tag: manylinux_2_28_aarch64
- os: macos-14
artifact: graphqlite-macos-arm64.dylib
extension: graphqlite.dylib
wheel_tag: macosx_11_0_arm64
- os: windows-latest
artifact: graphqlite-windows-x86_64.dll
extension: graphqlite.dll
wheel_tag: win_amd64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download extension artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.artifact }}
path: bindings/python/src/graphqlite/
- name: Rename extension to standard name
working-directory: bindings/python/src/graphqlite
run: mv ${{ matrix.artifact }} ${{ matrix.extension }}
shell: bash
- name: Install build tools
run: pip install build wheel
- name: Build wheel
working-directory: bindings/python
run: python -m build --wheel
- name: Retag wheel with platform
working-directory: bindings/python/dist
run: |
for whl in *.whl; do
python -m wheel tags --platform-tag=${{ matrix.wheel_tag }} "$whl"
rm "$whl"
done
shell: bash
- name: List wheels
run: ls -la bindings/python/dist/
shell: bash
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.wheel_tag }}
path: bindings/python/dist/*.whl
publish-python:
needs: build-wheels
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download all wheels
uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist/
merge-multiple: true
- name: Install build tools
run: pip install build twine
- name: Build source distribution
working-directory: bindings/python
run: python -m build --sdist
- name: Copy sdist to dist
run: cp bindings/python/dist/*.tar.gz dist/
- name: List distributions
run: ls -la dist/
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
publish-rust:
needs: build-and-test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
# Download pre-built extension binaries for all platforms
- name: Download Linux x86_64 extension
uses: actions/download-artifact@v4
with:
name: graphqlite-linux-x86_64.so
path: bindings/rust/libs/
- name: Download Linux ARM64 extension
uses: actions/download-artifact@v4
with:
name: graphqlite-linux-aarch64.so
path: bindings/rust/libs/
- name: Download macOS ARM64 extension
uses: actions/download-artifact@v4
with:
name: graphqlite-macos-arm64.dylib
path: bindings/rust/libs/
- name: Download macOS x86_64 extension
uses: actions/download-artifact@v4
with:
name: graphqlite-macos-x86_64.dylib
path: bindings/rust/libs/
- name: Download Windows extension
uses: actions/download-artifact@v4
with:
name: graphqlite-windows-x86_64.dll
path: bindings/rust/libs/
- name: Rename extensions to expected names
working-directory: bindings/rust/libs
run: |
mv graphqlite-linux-x86_64.so graphqlite-linux-x86_64.so || true
mv graphqlite-linux-aarch64.so graphqlite-linux-aarch64.so || true
mv graphqlite-macos-arm64.dylib graphqlite-macos-aarch64.dylib
mv graphqlite-macos-x86_64.dylib graphqlite-macos-x86_64.dylib || true
mv graphqlite-windows-x86_64.dll graphqlite-windows-x86_64.dll || true
ls -la
- name: Publish to crates.io
working-directory: bindings/rust
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --allow-dirty
# Create GitHub Release with binaries
create-release:
needs: build-and-test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Organize release assets
run: |
mkdir -p release-assets
# Copy extension binaries
cp artifacts/graphqlite-linux-x86_64.so/graphqlite-linux-x86_64.so release-assets/
cp artifacts/graphqlite-linux-aarch64.so/graphqlite-linux-aarch64.so release-assets/
cp artifacts/graphqlite-macos-arm64.dylib/graphqlite-macos-arm64.dylib release-assets/
cp artifacts/graphqlite-macos-x86_64.dylib/graphqlite-macos-x86_64.dylib release-assets/
cp artifacts/graphqlite-windows-x86_64.dll/graphqlite-windows-x86_64.dll release-assets/
# Copy CLI binaries
cp artifacts/gqlite-linux-x86_64/gqlite-linux-x86_64 release-assets/
cp artifacts/gqlite-linux-aarch64/gqlite-linux-aarch64 release-assets/
cp artifacts/gqlite-macos-arm64/gqlite-macos-arm64 release-assets/
cp artifacts/gqlite-macos-x86_64/gqlite-macos-x86_64 release-assets/
cp artifacts/gqlite-windows-x86_64.exe/gqlite-windows-x86_64.exe release-assets/
ls -la release-assets/
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: release-assets/*
generate_release_notes: true
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}