forked from celiagg/celiagg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build wheels for more platforms (celiagg#115)
Adds a separate build workflow using CIBuildWheel and then integrates it into the release workflow. This builds for CPython on Intel Mac, Intel Windows and Intel and ARM Linux (glibc only).
- Loading branch information
1 parent
5e298c8
commit 9ee4d37
Showing
4 changed files
with
76 additions
and
42 deletions.
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 |
---|---|---|
|
@@ -3,60 +3,47 @@ name: Publish release to PyPI | |
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
INSTALL_EDM_VERSION: 3.3.1 | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-sdist: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the release commit | ||
uses: actions/checkout@v3 | ||
- name: Setup EDM | ||
uses: enthought/setup-edm-action@v2 | ||
with: | ||
edm-version: ${{ env.INSTALL_EDM_VERSION }} | ||
- name: Install build environment | ||
run: | | ||
edm --config ci/.edm.yaml install -y --version 3.8 cython numpy | ||
edm run -- pip install twine | ||
- name: Build sdist | ||
run: edm run -- python setup.py sdist | ||
- name: Publish sdist to PyPI | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
edm run -- python -m twine check dist/*.tar.gz | ||
edm run -- python -m twine upload dist/*.tar.gz | ||
build-and-publish-wheel-all: | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-latest] | ||
|
||
build-wheel-linux: | ||
runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Check out the release commit | ||
uses: actions/checkout@v3 | ||
- name: Build manylinux Python wheels | ||
uses: RalfG/[email protected] | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311' | ||
build-requirements: 'cython numpy' | ||
system-packages: 'zlib-devel' | ||
pre-build-command: 'sh ci/build-wheel-deps.sh' | ||
platforms: arm64 | ||
if: runner.os == 'Linux' | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Python packages needed for wheel upload | ||
run: | | ||
python -m pip install --upgrade pip setuptools | ||
python -m pip install twine | ||
- name: Publish wheels to PyPI | ||
python-version: '3.11' | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
|
||
- name: Archive build | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: wheelhouse | ||
# don't need these kept for long | ||
retention-days: 7 | ||
|
||
- name: Check and upload wheels | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python -m twine check dist/*-manylinux*.whl | ||
python -m twine upload dist/*-manylinux*.whl | ||
python -m pip install twine | ||
python -m twine check --strict wheelhouse/*.whl | ||
python -m twine upload wheelhouse/*.whl |
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,38 @@ | ||
name: Build wheels and archive | ||
|
||
on: | ||
- workflow_dispatch | ||
|
||
jobs: | ||
build-wheel-all: | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Check out the release commit | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm64 | ||
if: runner.os == 'Linux' | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
|
||
- name: Archive build | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: wheelhouse | ||
# don't need these kept for long | ||
retention-days: 7 |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
[build-system] | ||
requires = ["cython", "oldest-supported-numpy", "setuptools", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.cibuildwheel] | ||
skip = 'pp* *-musllinux*' | ||
|
||
[tool.cibuildwheel.linux] | ||
archs = ['auto', 'aarch64'] | ||
before-all = "yum install -y freetype-devel harfbuzz-devel" | ||
|
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 |
---|---|---|
|
@@ -254,4 +254,5 @@ def create_extension(): | |
package_data={ | ||
'celiagg': ['data/*'], | ||
}, | ||
python_requires=">=3.7", | ||
) |