|
| 1 | +name: build_wheels.yml |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: |
| 5 | + - '**' |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + name: Build on ${{ matrix.platform || matrix.os }} (${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }}) |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + os: [ubuntu, macos, windows] |
| 14 | + target: [x86_64, aarch64] |
| 15 | + manylinux: [auto] |
| 16 | + include: |
| 17 | + - os: ubuntu |
| 18 | + platform: linux |
| 19 | + - os: windows |
| 20 | + ls: dir |
| 21 | + interpreter: 3.9 3.10 3.11 3.12 3.13 3.14 pypy3.11 |
| 22 | + - os: windows |
| 23 | + ls: dir |
| 24 | + target: aarch64 |
| 25 | + interpreter: 3.11 3.12 3.13 3.14 |
| 26 | + - os: macos |
| 27 | + target: aarch64 |
| 28 | + interpreter: 3.9 3.10 3.11 3.12 3.13 3.14 pypy3.11 |
| 29 | + - os: ubuntu |
| 30 | + platform: linux |
| 31 | + target: aarch64 |
| 32 | + # musllinux |
| 33 | + - os: ubuntu |
| 34 | + platform: linux |
| 35 | + target: x86_64 |
| 36 | + manylinux: musllinux_1_1 |
| 37 | + - os: ubuntu |
| 38 | + platform: linux |
| 39 | + target: aarch64 |
| 40 | + manylinux: musllinux_1_1 |
| 41 | + - os: ubuntu |
| 42 | + platform: linux |
| 43 | + target: ppc64le |
| 44 | + interpreter: 3.9 3.10 3.11 3.12 3.13 3.14 |
| 45 | + - os: ubuntu |
| 46 | + platform: linux |
| 47 | + target: s390x |
| 48 | + interpreter: 3.9 3.10 3.11 3.12 3.13 3.14 |
| 49 | + |
| 50 | + runs-on: ${{ matrix.os }}-latest |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 53 | + |
| 54 | + - name: set up python |
| 55 | + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 |
| 56 | + with: |
| 57 | + python-version: '3.11' |
| 58 | + architecture: ${{ matrix.python-architecture || 'x64' }} |
| 59 | + |
| 60 | + - name: build wheels |
| 61 | + uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4 |
| 62 | + with: |
| 63 | + target: ${{ matrix.target }} |
| 64 | + manylinux: ${{ matrix.manylinux || 'auto' }} |
| 65 | + container: ${{ matrix.container }} |
| 66 | + args: --release --out dist --interpreter ${{ matrix.interpreter || '3.9 3.10 3.11 3.12 3.13 3.14 pypy3.11' }} ${{ matrix.extra-build-args }} |
| 67 | + rust-toolchain: stable |
| 68 | + docker-options: -e CI |
| 69 | + |
| 70 | + - run: ${{ matrix.ls || 'ls -lh' }} dist/ |
| 71 | + |
| 72 | + - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 73 | + with: |
| 74 | + name: dist-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux }} |
| 75 | + path: dist |
| 76 | + |
| 77 | + build_sdist: |
| 78 | + runs-on: ubuntu-latest |
| 79 | + environment: release |
| 80 | + steps: |
| 81 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 82 | + - name: Build sdist |
| 83 | + uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4 |
| 84 | + with: |
| 85 | + command: sdist |
| 86 | + args: --out dist |
| 87 | + - name: Upload sdist |
| 88 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 89 | + with: |
| 90 | + name: dist-sdist |
| 91 | + path: dist |
| 92 | + |
| 93 | + build_no_ext: |
| 94 | + runs-on: ubuntu-latest |
| 95 | + environment: release |
| 96 | + steps: |
| 97 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 98 | + - name: Install and configure Poetry |
| 99 | + run: pipx install poetry |
| 100 | + - name: Hotswap build backend for Poetry |
| 101 | + # Maturin doesn't support building no-extension wheels, so we swap to Poetry for that |
| 102 | + run: | |
| 103 | + sed -i -e '/^\[build-system\]/,/^\[/{s/^requires = .*/requires = ["poetry-core>=2.0.0,<3.0.0"]/; s/^build-backend = .*/build-backend = "poetry.core.masonry.api"/}' pyproject.toml |
| 104 | + - name: Install dependencies |
| 105 | + run: poetry install --only main --only test --only typing --only build |
| 106 | + - name: Run poetry build |
| 107 | + run: poetry build -f wheel |
| 108 | + - name: Upload no-ext wheel |
| 109 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 110 | + with: |
| 111 | + name: dist-any |
| 112 | + path: dist |
0 commit comments