|
9 | 9 | pull_request: |
10 | 10 | workflow_dispatch: |
11 | 11 |
|
| 12 | +# Only cancels-in-progress on PRs (head_ref only defined in PR, fallback run_id always unique) |
| 13 | +concurrency: |
| 14 | + group: ${{ github.head_ref || github.run_id }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
12 | 17 | jobs: |
13 | 18 | build_wheels: |
14 | | - name: Build wheels on ${{ matrix.os }} |
15 | 19 | runs-on: ${{ matrix.os }} |
16 | 20 | strategy: |
| 21 | + fail-fast: false |
17 | 22 | matrix: |
18 | | - os: [ubuntu-latest, windows-latest, macos-13, macos-14] |
| 23 | + os: [ ubuntu-22.04, macos-14, windows-2022 ] |
| 24 | + python-version: [ "3.11", "3.12", "3.13", "3.14" ] |
| 25 | + |
| 26 | + env: |
| 27 | + PYTHON_VERSION: ${{ matrix.python-version }} |
| 28 | + |
19 | 29 | steps: |
20 | | - - uses: actions/checkout@v4 |
| 30 | + - uses: actions/checkout@v5 |
| 31 | + with: |
| 32 | + submodules: recursive |
| 33 | + |
| 34 | + - uses: actions/setup-python@v6 |
21 | 35 | with: |
22 | | - submodules: true |
| 36 | + python-version: ${{ matrix.python-version }} |
| 37 | + allow-prereleases: true |
| 38 | + |
| 39 | + - name: Set Python subversion |
| 40 | + shell: bash |
| 41 | + run: | |
| 42 | + echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV |
| 43 | +
|
| 44 | + - name: Set up QEMU |
| 45 | + if: runner.os == 'Linux' |
| 46 | + uses: docker/setup-qemu-action@v3 |
| 47 | + with: |
| 48 | + platforms: all |
23 | 49 |
|
24 | 50 | - name: Build wheels |
25 | 51 | uses: pypa/cibuildwheel@v2.22.0 |
26 | 52 | env: |
27 | | - CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-*" |
28 | | - CIBW_ARCHS_MACOS: "x86_64 arm64" |
| 53 | + CIBW_BUILD: "cp3${{ env.PYTHON_SUBVERSION }}-*" |
| 54 | + CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*" |
| 55 | + CIBW_ARCHS_MACOS: "x86_64 universal2" |
| 56 | + CIBW_ARCHS_LINUX: "auto aarch64" |
| 57 | + |
| 58 | + - name: Check wheels |
| 59 | + shell: bash |
| 60 | + run: | |
| 61 | + pip install --upgrade twine |
| 62 | + twine check wheelhouse/* |
29 | 63 |
|
30 | 64 | - uses: actions/upload-artifact@v4 |
31 | 65 | with: |
32 | | - name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
| 66 | + name: wheels-${{ matrix.os }}-${{ matrix.python-version }} |
33 | 67 | path: ./wheelhouse/*.whl |
34 | 68 |
|
35 | 69 | build_sdist: |
36 | | - name: Build source distribution |
37 | 70 | runs-on: ubuntu-latest |
38 | 71 | steps: |
39 | | - - uses: actions/checkout@v4 |
| 72 | + - uses: actions/checkout@v5 |
40 | 73 | with: |
41 | | - submodules: true |
| 74 | + submodules: recursive |
42 | 75 |
|
43 | 76 | - name: Build sdist |
44 | 77 | run: pipx run build --sdist |
45 | 78 |
|
46 | 79 | - uses: actions/upload-artifact@v4 |
47 | 80 | with: |
48 | | - name: cibw-sdist |
| 81 | + name: sdist |
49 | 82 | path: ./dist/*.tar.gz |
50 | 83 |
|
51 | 84 | upload_testpypi: |
|
58 | 91 | steps: |
59 | 92 | - uses: actions/download-artifact@v4 |
60 | 93 | with: |
61 | | - pattern: cibw-* |
| 94 | + pattern: "{wheels-*,sdist}" |
62 | 95 | path: dist |
63 | 96 | merge-multiple: true |
64 | 97 |
|
|
77 | 110 | steps: |
78 | 111 | - uses: actions/download-artifact@v4 |
79 | 112 | with: |
80 | | - pattern: cibw-* |
| 113 | + pattern: "{wheels-*,sdist}" |
81 | 114 | path: dist |
82 | 115 | merge-multiple: true |
83 | 116 |
|
|
0 commit comments