Add wheel building and testing ci #2
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: Publish sdist and wheels for manylinux, publish to pypi if a release | |
on: [pull_request, push] | |
env: | |
CIBW_BUILD_VERBOSITY: 3 | |
CIBW_BUILD: 'cp3*' | |
CIBW_SKIP: 'cp35-* cp36-* cp37-* *-musllinux_* *-manylinux_i686' | |
CIBW_TEST_COMMAND: "pytest {project}/tests" | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, ] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
with: | |
python-version: '3.8' | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel | |
- name: Build wheels on Linux | |
if: runner.os == 'Linux' | |
env: | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
run: | | |
python -m cibuildwheel --output-dir dist | |
- name: Store wheel as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist/*.whl | |
build_sdist: | |
name: Build sdist | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install packages | |
run: sudo apt-get update && sudo apt-get install libcgal-dev libeigen3-dev | |
- name: Build a source tarball, check if it installs | |
run: | |
./ci/python_build_sdist.sh | |
- name: Store sdist as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist/*.tar.gz | |
upload_artifacts: | |
name: Upload wheels to PyPI | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
needs: [build_wheels, build_sdist] | |
steps: | |
- name: Download artifacts produced during the build_wheels and build_sdist jobs | |
uses: actions/download-artifact@v3 | |
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@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} | |
packages_dir: dist/ |