Skip to content

Commit

Permalink
Add cibuildwheel
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Aug 2, 2022
1 parent 1f41868 commit 29ad58d
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/github-deploy.yml
@@ -0,0 +1,53 @@
name: Build and upload to PyPI
on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/cibuildwheel@v2.8.1

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build sdist
run: pipx run build --sdist

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

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.5.1
with:
user: __token__
password: ${{ secrets.pypi_password }}
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ master ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
@@ -0,0 +1,7 @@

[build-system]
requires = ["setuptools>=44"]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
skip = "pp*" # Disable building PyPy wheels on all platforms

0 comments on commit 29ad58d

Please sign in to comment.