| 1 |
--- |
| 2 |
name: Packages |
| 3 |
on: |
| 4 |
- workflow_dispatch |
| 5 |
|
| 6 |
jobs: |
| 7 |
|
| 8 |
build-sdist: |
| 9 |
name: Build sdist package |
| 10 |
runs-on: ubuntu-24.04 |
| 11 |
steps: |
| 12 |
- name: Checkout repos |
| 13 |
uses: actions/checkout@v4 |
| 14 |
|
| 15 |
- name: Build sdist |
| 16 |
run: python setup.py sdist |
| 17 |
|
| 18 |
- name: Upload artifacts |
| 19 |
uses: actions/upload-artifact@v4 |
| 20 |
with: |
| 21 |
name: sdist |
| 22 |
path: ./dist/* |
| 23 |
|
| 24 |
|
| 25 |
build-wheel: |
| 26 |
runs-on: ${{matrix.os}} |
| 27 |
strategy: |
| 28 |
fail-fast: false |
| 29 |
matrix: |
| 30 |
os: [ubuntu-24.04, windows-latest, macos-latest] |
| 31 |
pyver: [cp38, cp39, cp310, cp311, cp312, cp313, cp313t, cp314, cp314t] |
| 32 |
|
| 33 |
steps: |
| 34 |
- name: Checkout repos |
| 35 |
uses: actions/checkout@v4 |
| 36 |
|
| 37 |
- name: Build wheels |
| 38 |
uses: pypa/[email protected] |
| 39 |
env: |
| 40 |
CIBW_BUILD: ${{matrix.pyver}}-* |
| 41 |
CIBW_ARCHS_LINUX: auto |
| 42 |
CIBW_ARCHS_MACOS: auto universal2 |
| 43 |
CIBW_ARCHS_WINDOWS: auto |
| 44 |
CIBW_TEST_COMMAND: pytest --color=yes -m 'not embedded' {project}/tests |
| 45 |
# Passing a space in a param is a b*tch on windows. |
| 46 |
# However embedded tests are skipped anyway there. |
| 47 |
CIBW_TEST_COMMAND_WINDOWS: pytest --color=yes {project}/tests |
| 48 |
# musllinux tests fail with some pid mixup |
| 49 |
# cross-build macos images can't be tested on this runner. |
| 50 |
CIBW_TEST_SKIP: >- |
| 51 |
*-musllinux_* |
| 52 |
*-macosx_universal2:arm64 |
| 53 |
|
| 54 |
- name: Upload artifacts |
| 55 |
uses: actions/upload-artifact@v4 |
| 56 |
with: |
| 57 |
name: wheel-${{ matrix.pyver }}-${{ matrix.os }} |
| 58 |
path: ./wheelhouse/*.whl |
| 59 |
|
| 60 |
|
| 61 |
build-cross-wheel: |
| 62 |
runs-on: ubuntu-24.04 |
| 63 |
strategy: |
| 64 |
fail-fast: false |
| 65 |
matrix: |
| 66 |
pyver: [cp38, cp39, cp310, cp311, cp312, cp313, cp313t, cp314, cp314t] |
| 67 |
arch: [aarch64, ppc64le] |
| 68 |
|
| 69 |
steps: |
| 70 |
- name: Checkout repos |
| 71 |
uses: actions/checkout@v4 |
| 72 |
|
| 73 |
- name: Set up QEMU for multi-arch build |
| 74 |
uses: docker/setup-qemu-action@v3 |
| 75 |
|
| 76 |
- name: Build wheels |
| 77 |
uses: pypa/[email protected] |
| 78 |
env: |
| 79 |
CIBW_BUILD: ${{matrix.pyver}}-* |
| 80 |
CIBW_ARCHS: ${{matrix.arch}} |
| 81 |
|
| 82 |
# Tests mostly fail because of some confusion with the python interpreter |
| 83 |
|
| 84 |
- name: Upload artifacts |
| 85 |
uses: actions/upload-artifact@v4 |
| 86 |
with: |
| 87 |
name: wheel-${{ matrix.pyver }}-${{ matrix.arch }} |
| 88 |
path: ./wheelhouse/*.whl |
| 89 |
|
| 90 |
|
| 91 |
build-wheel-pypy: |
| 92 |
runs-on: ${{matrix.os}} |
| 93 |
strategy: |
| 94 |
fail-fast: false |
| 95 |
matrix: |
| 96 |
os: [ubuntu-24.04, windows-latest, macos-latest] |
| 97 |
|
| 98 |
steps: |
| 99 |
- name: Checkout repos |
| 100 |
uses: actions/checkout@v4 |
| 101 |
|
| 102 |
- name: Build wheels |
| 103 |
uses: pypa/[email protected] |
| 104 |
env: |
| 105 |
CIBW_BUILD: pp* |
| 106 |
CIBW_TEST_COMMAND: pytest --color=yes -m 'not embedded' {project}/tests |
| 107 |
# Passing a space in a param is a b*tch on windows. |
| 108 |
# However embedded tests are skipped anyway there. |
| 109 |
CIBW_TEST_COMMAND_WINDOWS: pytest --color=yes {project}/tests |
| 110 |
# musllinux tests fail with some pid mixup |
| 111 |
# cross-build macos images can't be tested on this runner. |
| 112 |
CIBW_TEST_SKIP: >- |
| 113 |
*-musllinux_* |
| 114 |
pp*-macosx_* |
| 115 |
|
| 116 |
- name: Upload artifacts |
| 117 |
uses: actions/upload-artifact@v4 |
| 118 |
with: |
| 119 |
name: wheels-pp-${{ matrix.os }} |
| 120 |
path: ./wheelhouse/*.whl |
| 121 |
|
| 122 |
|
| 123 |
build-cross-wheel-pypy: |
| 124 |
runs-on: ubuntu-24.04 |
| 125 |
|
| 126 |
steps: |
| 127 |
- name: Checkout repos |
| 128 |
uses: actions/checkout@v4 |
| 129 |
|
| 130 |
- name: Set up QEMU for multi-arch build |
| 131 |
uses: docker/setup-qemu-action@v3 |
| 132 |
|
| 133 |
- name: Build wheels |
| 134 |
uses: pypa/[email protected] |
| 135 |
env: |
| 136 |
CIBW_BUILD: pp* |
| 137 |
|
| 138 |
# Tests mostly fail because of some confusion with the python interpreter |
| 139 |
|
| 140 |
- name: Upload artifacts |
| 141 |
uses: actions/upload-artifact@v4 |
| 142 |
with: |
| 143 |
name: wheels-pp-cross |
| 144 |
path: ./wheelhouse/*.whl |
| 145 |
|
| 146 |
|
| 147 |
merge: |
| 148 |
runs-on: ubuntu-latest |
| 149 |
needs: |
| 150 |
- build-sdist |
| 151 |
- build-wheel |
| 152 |
- build-cross-wheel |
| 153 |
- build-wheel-pypy |
| 154 |
- build-cross-wheel-pypy |
| 155 |
steps: |
| 156 |
- name: Merge Artifacts |
| 157 |
uses: actions/upload-artifact/merge@v4 |
| 158 |
with: |
| 159 |
name: setproctitle-artifacts |
| 160 |
delete-merged: true |