|
| 1 | +name: Wheels |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + release: |
| 6 | + types: |
| 7 | + - published |
| 8 | + |
| 9 | +env: |
| 10 | + CIBW_TEST_COMMAND: pytest {project}/tests |
| 11 | + CIBW_TEST_REQUIRES: pytest numpy scipy |
| 12 | + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 |
| 13 | + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 |
| 14 | + CIBW_SKIP: "*-win32 *_i686 pp* *-musllinux* cp38-macosx_arm64 cp313*" # Skip PyPy, 32-bit builds, musl linux, Python 3.13 |
| 15 | + CIBW_BEFORE_ALL_LINUX: "yum install -y lapack-devel" |
| 16 | + CIBW_ARCHS_WINDOWS: auto64 |
| 17 | + CIBW_ARCHS_LINUX: auto64 |
| 18 | + CIBW_ARCHS_MACOS: x86_64 arm64 |
| 19 | + CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.14 |
| 20 | + |
| 21 | +jobs: |
| 22 | + build_sdist: |
| 23 | + name: Build SDist |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v2 |
| 27 | + with: |
| 28 | + submodules: true |
| 29 | + |
| 30 | + - name: Build SDist |
| 31 | + run: pipx run build --sdist |
| 32 | + |
| 33 | + - name: Check metadata |
| 34 | + run: pipx run twine check dist/* |
| 35 | + |
| 36 | + - uses: actions/upload-artifact@v2 |
| 37 | + with: |
| 38 | + path: dist/*.tar.gz |
| 39 | + |
| 40 | + build_wheels: |
| 41 | + name: Wheels on ${{ matrix.os }} |
| 42 | + runs-on: ${{ matrix.os }} |
| 43 | + strategy: |
| 44 | + fail-fast: false |
| 45 | + matrix: |
| 46 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 47 | + |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v2 |
| 50 | + with: |
| 51 | + submodules: true |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + - name: Verify clean directory |
| 56 | + run: git diff --exit-code |
| 57 | + shell: bash |
| 58 | + |
| 59 | + - name: Check metadata |
| 60 | + run: pipx run twine check wheelhouse/* |
| 61 | + |
| 62 | + - name: Upload wheels |
| 63 | + uses: actions/upload-artifact@v2 |
| 64 | + with: |
| 65 | + path: wheelhouse/*.whl |
| 66 | + |
| 67 | + upload_all: |
| 68 | + name: Upload if release |
| 69 | + needs: [build_wheels, build_sdist] |
| 70 | + runs-on: ubuntu-latest |
| 71 | + if: github.event_name == 'release' && github.event.action == 'published' |
| 72 | + |
| 73 | + steps: |
| 74 | + - uses: actions/setup-python@v2 |
| 75 | + |
| 76 | + - uses: actions/download-artifact@v2 |
| 77 | + with: |
| 78 | + name: artifact |
| 79 | + path: dist |
| 80 | + |
| 81 | + |
| 82 | + with: |
| 83 | + user: __token__ |
| 84 | + password: ${{ secrets.pypi_password }} |
0 commit comments