Skip to content

Commit

Permalink
Update python-package.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
K0lb3 committed Dec 6, 2021
1 parent 3a62923 commit 0a880af
Showing 1 changed file with 59 additions and 63 deletions.
122 changes: 59 additions & 63 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,60 @@ name: Windows & Mac Build
on: [push, pull_request]

jobs:
deploy:
# Build the wheels for Linux, Windows and macOS for Python 3.6 and newer
build_wheels:
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
runs-on: ${{ matrix.os }}
#needs: check_build_trigger
#if: needs.check_build_trigger.outputs.build

strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
os: ['macOS-latest', 'windows-latest']
python-version: ['3.10', '3.9', '3.8', '3.7', '3.6']
compiler: ['gcc']
architecture: ['x86', 'x64']
os: [windows-latest, ubuntu-latest, macos-latest]
python: [36, 37, 38, 39, 310]
bitness: [32, 64]
manylinux_image: [manylinux1, manylinux2010, manylinux_x_y]
include:
# Run 32 and 64 bit version in parallel for Linux and Windows
- os: windows-latest
bitness: 64
platform_id: win_amd64
- os: windows-latest
bitness: 32
platform_id: win32
- os: ubuntu-latest
bitness: 64
platform_id: manylinux_x86_64
- os: ubuntu-latest
bitness: 32
platform_id: manylinux_i686
- os: macos-latest
bitness: 64
platform_id: macosx_x86_64

- os: ubuntu-latest
bitness: 64
platform_id: manylinux_aarch64
- os: ubuntu-latest
bitness: 64
platform_id: manylinux_ppc64le

exclude:
- os: macos-latest
python-version: 3.6

timeout-minutes: 30

runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.architecture }} - ${{ matrix.python-version }}

bitness: 32
# Remove manylinux1 from the windows and osx build matrix since
# manylinux_image is not used for these platforms
- os: windows-latest
manylinux_image: manylinux1
- os: macos-latest
manylinux_image: manylinux1
- os: macos-latest
manylinux_image: manylinux2010
- os: macos-latest
manylinux_image: manylinux_x_y

steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -49,7 +85,16 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel pytest twine
pip install --upgrade setuptools wheel pytest twine pillow
# Syntax check
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# Build
- name: Build package
Expand All @@ -74,53 +119,4 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/* --skip-existing
manylinux:
if: success() && github.event_name == 'push'
needs: [deploy]

strategy:
matrix:
os: [ubuntu-20.04]
compiler: ['gcc']

name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel pytest twine pillow
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Build wheels
uses: joerick/cibuildwheel@v2.3.0
env:
CIBW_ARCHS_LINUX: auto aarch64
CIBW_BUILD: |
cp36-manylinux_x86_64 cp36-manylinux_i686 cp36-manylinux_aarch64
cp37-manylinux_x86_64 cp37-manylinux_i686 cp37-manylinux_aarch64
cp38-manylinux_x86_64 cp38-manylinux_i686 cp38-manylinux_aarch64
cp39-manylinux_x86_64 cp39-manylinux_i686 cp39-manylinux_aarch64
cp310-manylinux_x86_64 cp310-manylinux_i686 cp310-manylinux_aarch64
- name: Publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/* --skip-existing
twine upload ./wheelhouse/*.whl --skip-existing
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
twine upload dist/* --skip-existing

0 comments on commit 0a880af

Please sign in to comment.