|
| 1 | +name: build_wheels |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build_wheels: |
| 7 | + name: ${{ matrix.os }} |
| 8 | + runs-on: ${{ matrix.os }} |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + os: [ubuntu-18.04, windows-latest, macos-latest] |
| 12 | + |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + |
| 16 | + - uses: actions/setup-python@v2 |
| 17 | + name: Install Python |
| 18 | + with: |
| 19 | + python-version: '3.7' |
| 20 | + - name: Install cibuildwheel |
| 21 | + run: | |
| 22 | + python -m pip install cibuildwheel==1.5.1 |
| 23 | + - name: Build wheels |
| 24 | + env: |
| 25 | + # We only build for Python 3.6+. On Linux manylinux2010 is used. |
| 26 | + # Skipping pypy wheels for now since scipy & scikit-learn haven't build them yet. |
| 27 | + CIBW_SKIP: "pp* *p27* *p35*" |
| 28 | + CIBW_TEST_REQUIRES: "pytest pandas scikit-learn" |
| 29 | + CIBW_TEST_COMMAND: "pytest --pyargs sklearn_extra" |
| 30 | + run: | |
| 31 | + python -m cibuildwheel --output-dir wheelhouse |
| 32 | + - uses: actions/upload-artifact@v2 |
| 33 | + with: |
| 34 | + path: ./wheelhouse/*.whl |
| 35 | + |
| 36 | + build_sdist: |
| 37 | + name: sdist |
| 38 | + runs-on: ubuntu-latest |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v2 |
| 41 | + |
| 42 | + - uses: actions/setup-python@v2 |
| 43 | + name: Install Python |
| 44 | + with: |
| 45 | + python-version: '3.7' |
| 46 | + |
| 47 | + - name: Install dependencies |
| 48 | + run: pip install setuptools cython numpy |
| 49 | + |
| 50 | + - name: Build sdist |
| 51 | + run: python setup.py sdist |
| 52 | + |
| 53 | + - uses: actions/upload-artifact@v2 |
| 54 | + with: |
| 55 | + path: dist/*.tar.gz |
| 56 | + |
| 57 | + upload_pypi: |
| 58 | + needs: [build_wheels, build_sdist] |
| 59 | + runs-on: ubuntu-latest |
| 60 | + # upload to PyPI on every tag starting with 'v' |
| 61 | + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') |
| 62 | + steps: |
| 63 | + - uses: actions/download-artifact@v2 |
| 64 | + with: |
| 65 | + name: artifact |
| 66 | + path: dist |
| 67 | + |
| 68 | + - uses: pypa/gh-action-pypi-publish@master |
| 69 | + with: |
| 70 | + user: __token__ |
| 71 | + password: ${{ secrets.pypi_password }} |
| 72 | + # To test: |
| 73 | + repository_url: https://test.pypi.org/legacy/ |
0 commit comments