Skip to content

Commit

Permalink
- Use custom branch of py-build-cmake
Browse files Browse the repository at this point in the history
- Concurrent building for different arch
  • Loading branch information
laggykiller committed Jul 24, 2023
1 parent a043537 commit e75187f
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 7 deletions.
92 changes: 86 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- published

jobs:
build_wheels:
build_wheels_x86:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -25,9 +25,9 @@ jobs:
uses: laggykiller/[email protected]
env:
CIBW_BUILD_FRONTEND: build
CIBW_ARCHS_WINDOWS: AMD64 x86 ARM64
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
CIBW_ARCHS_LINUX: x86_64 i686 aarch64 ppc64le s390x
CIBW_ARCHS_WINDOWS: AMD64 x86
CIBW_ARCHS_MACOS: x86_64
CIBW_ARCHS_LINUX: x86_64 i686
# If enable stubgen (pyproject.toml), then requires mypy which depends on typed-ast
# typed-ast cannot run on pypy <3.8
# https://mypy.readthedocs.io/en/stable/faq.html
Expand All @@ -36,7 +36,87 @@ jobs:
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_wheels_arm:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Build wheels
uses: laggykiller/[email protected]
env:
CIBW_BUILD_FRONTEND: build
CIBW_ARCHS_WINDOWS: ARM64
CIBW_ARCHS_MACOS: universal2 arm64
CIBW_ARCHS_LINUX: aarch64
# If enable stubgen (pyproject.toml), then requires mypy which depends on typed-ast
# typed-ast cannot run on pypy <3.8
# https://mypy.readthedocs.io/en/stable/faq.html
# CIBW_SKIP: pp37-*

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

build_wheels_ppc64le:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Build wheels
uses: laggykiller/[email protected]
env:
CIBW_BUILD_FRONTEND: build
CIBW_ARCHS_LINUX: ppc64le
# If enable stubgen (pyproject.toml), then requires mypy which depends on typed-ast
# typed-ast cannot run on pypy <3.8
# https://mypy.readthedocs.io/en/stable/faq.html
# CIBW_SKIP: pp37-*

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

build_wheels_s390x:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Build wheels
uses: laggykiller/[email protected]
env:
CIBW_BUILD_FRONTEND: build
CIBW_ARCHS_LINUX: s390x
# If enable stubgen (pyproject.toml), then requires mypy which depends on typed-ast
# typed-ast cannot run on pypy <3.8
# https://mypy.readthedocs.io/en/stable/faq.html
# CIBW_SKIP: pp37-*

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

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
Expand All @@ -53,7 +133,7 @@ jobs:
path: dist/*.tar.gz

upload_pypi_test:
needs: [build_wheels, build_sdist]
needs: [build_wheels_x86, build_wheels_arm, build_wheels_ppc64le, build_wheels_s390x, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
Expand All @@ -72,7 +152,7 @@ jobs:
repository_url: https://test.pypi.org/legacy/

upload_pypi:
needs: [build_wheels, build_sdist]
needs: [build_wheels_x86, build_wheels_arm, build_wheels_ppc64le, build_wheels_s390x, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Tracker = "https://github.com/laggykiller/rlottie-python/issues"
repository = "https://github.com/laggykiller/rlottie-python"

[build-system] # How pip and other frontends should build this project
requires = ["py-build-cmake~=0.1.2"]
requires = ["py-build-cmake @ git+https://github.com/laggykiller/py-build-cmake.git@main"]
build-backend = "py_build_cmake.build"

[tool.py-build-cmake.module] # Where to find the Python module to package
Expand Down

0 comments on commit e75187f

Please sign in to comment.