Skip to content

Commit

Permalink
Add cibuildwheel configuration
Browse files Browse the repository at this point in the history
To allow us to automatically build wheels for the project, add
`cibuildwheel` configuration files that run automatically with GitHub
actions.
  • Loading branch information
pablogsal committed Apr 12, 2022
1 parent ad01ae9 commit 7d31d1c
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and upload to PyPI

on:
release:
types:
- published

jobs:
build_wheels:
name: Build wheels on Linux
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

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

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

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

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

- uses: actions/upload-artifact@v2
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@v2
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,15 @@ ignore = [

[tool.mypy]
exclude="tests/integration/(native_extension|multithreaded_extension)/"

[tool.cibuildwheel]
build = ["cp37-*", "cp38-*", "cp39-*", "cp310-*"]
skip = "*musllinux*"

[tool.cibuildwheel.linux]
before-all = "yum install -y libunwind-devel"
manylinux-x86_64-image = "manylinux2010"
manylinux-i686-image = "manylinux2010"
manylinux-aarch64-image = "manylinux2010"
manylinux-ppc64le-image = "manylinux2010"
manylinux-s390x-image = "manylinux2010"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def build_js_files(self):
library_dirs=[str(LIBBACKTRACE_LIBDIR)],
include_dirs=["src", str(LIBBACKTRACE_INCLUDEDIRS)],
language="c++",
extra_compile_args=["-std=c++17", "-Wall", "-Werror", *EXTRA_COMPILE_ARGS],
extra_compile_args=["-std=c++17", "-Wall", *EXTRA_COMPILE_ARGS],
extra_link_args=["-std=c++17", "-l:libbacktrace.a"],
define_macros=DEFINE_MACROS,
)
Expand Down

0 comments on commit 7d31d1c

Please sign in to comment.