|
1 | 1 | name: Build |
2 | 2 |
|
| 3 | +# TODO: only run on published releases |
| 4 | +# on: |
| 5 | +# release: |
| 6 | +# types: [published] |
3 | 7 | on: [push, pull_request] |
4 | 8 |
|
5 | 9 | jobs: |
6 | 10 | build_wheels: |
7 | 11 | name: Build wheels on ${{ matrix.os }} |
8 | 12 | runs-on: ${{ matrix.os }} |
9 | 13 | strategy: |
| 14 | + fail-fast: false |
10 | 15 | matrix: |
11 | 16 | # macos-13 is an intel runner, macos-14 is apple silicon |
12 | 17 | os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-13, macos-14] |
|
23 | 28 | with: |
24 | 29 | # TODO: figure out whether we need to use other compilers too |
25 | 30 | compiler: "gcc" |
26 | | - version: "13" |
| 31 | + version: "10" |
27 | 32 |
|
28 | 33 | - name: Build wheels |
29 | 34 | uses: pypa/cibuildwheel@v3.1.4 |
|
38 | 43 | - uses: actions/upload-artifact@v4 |
39 | 44 | with: |
40 | 45 | name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
41 | | - path: ./wheelhouse/*.whl |
| 46 | + path: wheelhouse/*.whl |
| 47 | + |
| 48 | + make_sdist: |
| 49 | + name: Make source distribution |
| 50 | + runs-on: "ubuntu-latest" |
| 51 | + |
| 52 | + steps: |
| 53 | + - name: Check out repository |
| 54 | + uses: actions/checkout@v4 |
| 55 | + with: |
| 56 | + fetch-depth: 0 |
| 57 | + |
| 58 | + - uses: ./.github/actions/setup |
| 59 | + with: |
| 60 | + python-version: ${{ matrix.python-version }} |
| 61 | + uv-dependency-install-flags: "--all-extras --group dev" |
| 62 | + |
| 63 | + - name: Create source distribution |
| 64 | + run: uv build --sdist |
| 65 | + |
| 66 | + - name: Upload the source distribution artefact |
| 67 | + uses: actions/upload-artifact@v4 |
| 68 | + with: |
| 69 | + name: cibw-sdist |
| 70 | + path: dist/*.tar.gz |
| 71 | + |
| 72 | + deploy-pypi: |
| 73 | + needs: [build_wheels, make_sdist] |
| 74 | + # Having an environment for deployment is strongly recommend by PyPI |
| 75 | + # https://docs.pypi.org/trusted-publishers/adding-a-publisher/#github-actions |
| 76 | + # You can comment this line out if you don't want it. |
| 77 | + environment: deploy |
| 78 | + permissions: |
| 79 | + # this permission is mandatory for trusted publishing with PyPI |
| 80 | + id-token: write |
| 81 | + runs-on: ubuntu-latest |
| 82 | + steps: |
| 83 | + - name: Download wheels |
| 84 | + uses: actions/download-artifact@v5 |
| 85 | + with: |
| 86 | + pattern: cibw-* |
| 87 | + path: wheelhouse |
| 88 | + merge-multiple: true |
| 89 | + - name: Download sdist |
| 90 | + uses: actions/download-artifact@v5 |
| 91 | + with: |
| 92 | + pattern: cibw-* |
| 93 | + path: dist |
| 94 | + merge-multiple: true |
| 95 | + - name: Diagnose where things are |
| 96 | + run: | |
| 97 | + ls dist |
| 98 | + ls wheelhouse |
| 99 | + # - name: Publish to PyPI |
| 100 | + # run: | |
| 101 | + # uv publish |
0 commit comments