Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Build Wheels

Build Wheels #2

Workflow file for this run

name: Build Wheels
on:
release:
types: [published]
workflow_dispatch: # Allow manual trigger
inputs:
use_self_hosted:
description: 'Use self-hosted runner with GCC 16+ trunk'
required: false
default: 'true'
type: boolean
jobs:
build_wheels_self_hosted:
name: Build wheels on self-hosted runner (GCC 16+ trunk)
runs-on: self-hosted
if: github.event.inputs.use_self_hosted == 'true' || github.event_name == 'release'
steps:
- uses: actions/checkout@v4
- name: Verify GCC 16+ trunk
run: |
g++ --version
g++ -std=c++26 -freflection -x c++ - <<< 'int main() {}' || {
echo "ERROR: GCC 16+ trunk with -freflection not available"
exit 1
}
echo "SUCCESS: GCC 16+ trunk with -freflection available"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
# Build for Python 3.9, 3.10, 3.11, 3.12
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
# Skip 32-bit builds and musl on Linux
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
# Use manylinux2014 for better compatibility
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
# Install build dependencies
CIBW_BEFORE_BUILD: pip install nanobind scikit-build-core
# Run tests after build
CIBW_TEST_COMMAND: python -c "import libsqlglot; print('Import test passed')"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-self-hosted
path: ./wheelhouse/*.whl
build_wheels_fallback:
name: Fallback notice (no self-hosted runner)
runs-on: ubuntu-latest
if: github.event.inputs.use_self_hosted == 'false'
steps:
- name: C++26 Requirement Notice
run: |
echo "WARNING: Python wheel builds require C++26 with GCC 16+ trunk"
echo "WARNING: Self-hosted runner not enabled for this build"
echo "NOTE: To build wheels, set up a self-hosted runner with GCC 16+ trunk"
echo "NOTE: See DEVELOPMENT.md for self-hosted runner setup"
upload_pypi:
name: Upload to PyPI
needs: [build_wheels_self_hosted]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}