Publish cppbinder as a Python package #30
Workflow file for this run
This file contains 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: Wheels | |
on: | |
pull_request: | |
branches: | |
- master | |
release: | |
types: [published] | |
concurrency: | |
group: wheels-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# macos-13 is an intel runner, macos-14 is apple silicon | |
os: | |
- windows-latest | |
- ubuntu-latest | |
- macos-13 | |
- macos-14 | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pybind11 | |
- name: Install LLVM and Clang | |
uses: KyleMayes/install-llvm-action@v2 | |
with: | |
version: "11.0" | |
directory: ${{ runner.temp }}/llvm | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_ENVIRONMENT: LLVM_DIR=${{ runner.temp }}/llvm Clang_DIR=${{ runner.temp }}/llvm | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
- name: Upload wheels to release | |
if: github.event_name == 'release' | |
run: | | |
gh release upload ${{ github.ref_name }} ./wheelhouse/*.whl --clobber | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish package to PyPI | |
if: github.event_name == 'release' | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages-dir: wheelhouse |