-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action for building wheels
- Loading branch information
Showing
2 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
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
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 }} |
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