|
10 | 10 |
|
11 | 11 | jobs: |
12 | 12 | build_sdist: |
13 | | - name: Build SDist |
14 | 13 | runs-on: ubuntu-latest |
15 | 14 | steps: |
16 | | - - uses: actions/checkout@v4 |
17 | | - with: |
18 | | - submodules: true |
19 | | - |
20 | | - - name: Build SDist |
21 | | - run: pipx run build --sdist |
22 | | - |
23 | | - - name: Check metadata |
24 | | - run: pipx run twine check dist/* |
25 | | - |
26 | | - - uses: actions/upload-artifact@v4 |
27 | | - with: |
28 | | - name: dist-sdist |
29 | | - path: dist/*.tar.gz |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + submodules: true |
| 18 | + - run: pipx run build --sdist |
| 19 | + - run: pipx run twine check dist/* |
| 20 | + - uses: actions/upload-artifact@v4 |
| 21 | + with: |
| 22 | + name: dist-sdist |
| 23 | + path: dist/*.tar.gz |
30 | 24 |
|
31 | 25 | build_wheels: |
32 | | - name: Build ${{ matrix.cpversion }} wheels on ${{ matrix.os }} |
33 | 26 | runs-on: ${{ matrix.os }} |
34 | 27 | strategy: |
35 | 28 | fail-fast: false |
36 | 29 | matrix: |
37 | | - os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14] |
38 | | - # cp313 seemed to produce the same wheel name as cp312. Skip unless |
39 | | - # necessary. |
40 | | - cpversion: [cp38, cp39, cp310, cp311, cp312] |
41 | | - # github actions cp38 on macos-14 runners are cross compiling or |
42 | | - # something and confusing the stub generation. Just skip it for now. |
43 | | - # Maybe it'd be friendlier to disable the stub generation for this |
44 | | - # combination. |
| 30 | + os: [ubuntu-latest, ubuntu-24.04-arm, macos-15, windows-latest] |
| 31 | + arch: [x86_64, arm64] |
45 | 32 | exclude: |
46 | | - - os: macos-14 |
47 | | - cpversion: cp38 |
48 | | - |
49 | | - |
| 33 | + - os: ubuntu-latest |
| 34 | + arch: arm64 |
| 35 | + - os: macos-15 |
| 36 | + pybuilds: cp38 |
| 37 | + pybuilds: [cp38, cp39, cp310, cp311, cp312] |
50 | 38 | steps: |
51 | 39 | - uses: actions/checkout@v4 |
52 | | - |
53 | 40 | - uses: actions/setup-python@v5 |
54 | 41 | with: |
55 | 42 | python-version: '3.12' |
56 | | - |
57 | | - - name: Install cibuildwheel |
58 | | - run: python -m pip install cibuildwheel==2.22.0 |
59 | | - |
60 | | - - name: Build wheels |
61 | | - # why do I need to specify this cpversion here? |
| 43 | + - run: pip install cibuildwheel==2.22.0 |
| 44 | + - run: python -m cibuildwheel --output-dir wheelhouse |
62 | 45 | env: |
63 | | - CIBW_ARCHS: "auto64" |
64 | | - CIBW_BUILD: "${{ matrix.cpversion }}-*" |
65 | | - # why isn't auto64 working? |
66 | | - CIBW_SKIP: "cp*-manylinux_i686 cp*-musllinux* cp*-win32" |
67 | | - run: python -m cibuildwheel --output-dir wheelhouse |
68 | | - |
| 46 | + CIBW_BUILD: "${{ matrix.pybuilds }}-*" |
| 47 | + CIBW_ARCHS_MACOS: ${{ matrix.arch }} |
| 48 | + CIBW_SKIP: "cp*-manylinux_i686 cp*-musllinux* cp*-win32" |
69 | 49 | - uses: actions/upload-artifact@v4 |
70 | 50 | with: |
71 | | - name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
72 | | - path: ./wheelhouse/*.whl |
| 51 | + name: wheels-${{ matrix.os }}-${{ matrix.arch }} |
| 52 | + path: wheelhouse/* |
| 53 | + |
| 54 | + release_artifacts: |
| 55 | + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 56 | + needs: build_wheels |
| 57 | + runs-on: ubuntu-latest |
| 58 | + permissions: |
| 59 | + id-token: write |
| 60 | + contents: write |
| 61 | + steps: |
| 62 | + - uses: actions/download-artifact@v4 |
| 63 | + with: |
| 64 | + path: ./artifacts |
| 65 | + merge-multiple: true |
| 66 | + - run: ls -R ./artifacts |
| 67 | + - uses: ncipollo/release-action@v1 |
| 68 | + with: |
| 69 | + allowUpdates: true |
| 70 | + artifacts: "./artifacts/**/*" |
| 71 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 72 | + - uses: pypa/gh-action-pypi-publish@v1.12.4 |
| 73 | + with: |
| 74 | + packages-dir: ./artifacts |
0 commit comments