Skip to content

Workflow file for this run

name: Publish sdist and wheels macos-manylinux
on:
release:
types: [created]
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
MACOSX_DEPLOYMENT_TARGET: '10.13'
CIBW_BUILD_VERBOSITY: 2
# Only build on Python 3.x
CIBW_BUILD: 'cp3?-*'
CIBW_SKIP: 'cp35-* cp310-* *-manylinux_i686'
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-12]
steps:
- uses: actions/checkout@master
with:
submodules: true
- uses: actions/setup-python@master
name: Install Python
with:
python-version: '3.9'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.6.4
- name: Build wheels on Linux
if: runner.os == 'Linux'
env:
CIBW_BEFORE_BUILD: |
yum update -y
python -m pip install pybind11
run: |
python -m cibuildwheel --output-dir dist
- name: Build wheels Mac OS
if: runner.os == 'macOS'
env:
CIBW_BEFORE_BUILD: |
brew update
brew unlink gcc@8 gcc@9
brew install cmake
python -m pip install pybind11
run: |
python -m cibuildwheel --output-dir dist
- name: Store wheel as artifact
uses: actions/upload-artifact@master
with:
name: dist
path: dist
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
submodules: true
- name: Set up Python 3.9
uses: actions/setup-python@master
with:
python-version: 3.9
- name: Build a source tarball
run: |
python -m pip install pybind11
python setup.py sdist
- name: Store sdist as artifact
uses: actions/upload-artifact@master
with:
name: dist
path: dist
upload_wheels:
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
name: Upload wheels to PyPI
steps:
- name: Download artifacts produced during the build_wheels and build_sdist jobs
uses: actions/download-artifact@master
with:
name: dist
path: dist
- name: Display structure of downloaded files
run: ls -R
working-directory: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_RELEASE}}
packages_dir: dist/