Skip to content

Commit

Permalink
Add GitHub action for building wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
lordmauve committed Mar 2, 2021
1 parent df7c738 commit 31a3a58
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 1 deletion.
78 changes: 78 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: "Build Wheels"

on:
workflow_dispatch:
push:
release:
types:
- published

jobs:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install wheel and SDist requirements
run: python -m pip install "setuptools>=42.0" cython wheel twine

- name: Build SDist
run: python setup.py sdist

- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz

build_wheels:
name: Wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v1
with:
submodules: true

- name: Setup Python
uses: actions/setup-python@v2

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.5.5

- name: Build wheel
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: pp* cp27*
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: pytest {project}
CIBW_TEST_REQUIRES: pytest hypothesis
CIBW_BUILD_VERBOSITY: 1
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1

- name: Upload wheels
uses: actions/upload-artifact@v2
with:
path: wheelhouse/*.whl

publish:
needs: [dist, build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py34, py35, py36, py37, flake8
envlist = py36, py37, py38, py39, flake8

[testenv:flake8]
basepython=python
Expand Down

0 comments on commit 31a3a58

Please sign in to comment.