This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Build Wheels #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: Install Python build dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| python -m pip install nanobind scikit-build-core build | |
| - name: Build wheel (native, not in container) | |
| run: python -m build --wheel --outdir wheelhouse | |
| env: | |
| CMAKE_BUILD_TYPE: Release | |
| CMAKE_ARGS: "-DLIBSQLGLOT_BUILD_TESTS=OFF -DLIBSQLGLOT_BUILD_BENCHMARKS=OFF" | |
| - 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 }} |