|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | wheels: |
10 | | - name: "Create wheels for ${{ matrix.BUILD.NAME }}" |
| 10 | + name: "Wheels for ${{ matrix.BUILD.NAME }}" |
11 | 11 | runs-on: ${{ matrix.BUILD.OS }} |
12 | 12 | strategy: |
13 | 13 | fail-fast: false |
|
74 | 74 | name: Distribution Artifacts |
75 | 75 | path: wheelhouse/*.whl |
76 | 76 |
|
| 77 | + wheels-macos-universal: |
| 78 | + # `cibuildwheel` does not support building CPython 3.6/3.7 wheels for macOS ARM64 |
| 79 | + # This job build universal wheel that covers these versions. |
| 80 | + # Non-universal wheels are also in place, because they have smaller size & will be used in Python 3.8+ installations |
| 81 | + name: "Wheels for macOS universal2" |
| 82 | + runs-on: macos-11 |
| 83 | + steps: |
| 84 | + - uses: actions/checkout@v2 |
| 85 | + - name: Setup python |
| 86 | + run: | |
| 87 | + curl "$PYTHON_DOWNLOAD_URL" -o python.pkg |
| 88 | + sudo installer -pkg python.pkg -target / |
| 89 | + env: |
| 90 | + PYTHON_DOWNLOAD_URL: 'https://www.python.org/ftp/python/3.10.0/python-3.10.0post2-macos11.pkg' |
| 91 | + - uses: actions-rs/toolchain@v1 |
| 92 | + with: |
| 93 | + profile: minimal |
| 94 | + toolchain: stable |
| 95 | + override: true |
| 96 | + default: true |
| 97 | + target: aarch64-apple-darwin |
| 98 | + - run: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m venv venv |
| 99 | + - run: venv/bin/pip install -U pip wheel setuptools-rust |
| 100 | + - run: mkdir wheelhouse |
| 101 | + - name: Build the wheel |
| 102 | + run: | |
| 103 | + cd bindings/python && \ |
| 104 | + ../../venv/bin/python setup.py bdist_wheel --py-limited-api=cp36 && \ |
| 105 | + mv dist/css_inline*.whl ../../wheelhouse |
| 106 | + env: |
| 107 | + MACOSX_DEPLOYMENT_TARGET: '10.10' |
| 108 | + ARCHFLAGS: '-arch x86_64 -arch arm64' |
| 109 | + _PYTHON_HOST_PLATFORM: 'macosx-10.9-universal2' |
| 110 | + - run: venv/bin/pip install -f wheelhouse --no-index css_inline |
| 111 | + - run: find venv/lib/*/site-packages/ -name 'css_inline*.so' -exec vtool -show {} \; |
| 112 | + - uses: actions/upload-artifact@v2 |
| 113 | + with: |
| 114 | + name: Distribution Artifacts |
| 115 | + path: wheelhouse/*.whl |
| 116 | + |
77 | 117 | sdist: |
78 | | - name: Create sdist package |
| 118 | + name: Sdist package |
79 | 119 | runs-on: ubuntu-20.04 |
80 | 120 | steps: |
81 | 121 | - uses: actions/checkout@v2 |
|
96 | 136 | upload_to_pypi: |
97 | 137 | needs: |
98 | 138 | - wheels |
| 139 | + - wheels-macos-universal |
99 | 140 | - sdist |
100 | 141 | name: Upload Artifacts to PyPi |
101 | 142 | runs-on: ubuntu-20.04 |
|
0 commit comments