Skip to content

Commit

Permalink
refactor cibuildwheel
Browse files Browse the repository at this point in the history
Former-commit-id: ab2a584
  • Loading branch information
MaxHalford committed Dec 1, 2021
1 parent 8997df5 commit 9c981c8
Showing 1 changed file with 37 additions and 24 deletions.
61 changes: 37 additions & 24 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,50 @@ on:
- "*"

jobs:
pypi:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.platform }}
env:
CIBW_BUILD: "cp37-* cp38-* cp39-*"
CIBW_BEFORE_BUILD: "pip install cython"
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp37-* cp38-* cp39-*"
CIBW_BEFORE_BUILD: "pip install cython"

- uses: actions/upload-artifact@v2
with:
python-version: 3.8
path: ./wheelhouse/*.whl

- name: Install Python dependencies
run: |
pip install wheel
pip install -e ".[compat,dev]" cibuildwheel twine
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Download datasets
run: python -c "from river import datasets; datasets.CreditCard().download()"
- name: Build sdist
run: pipx run build --sdist

- name: pytest
run: |
pytest
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz

- name: Build wheels
run: |
cibuildwheel --output-dir dist
python setup.py sdist
ls dist
twine upload dist/* -u ${{ secrets.pypi_user }} -p ${{ secrets.pypi_password }} --skip-existing
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
user: ${{ secrets.pypi_user }}
password: ${{ secrets.pypi_password }}

0 comments on commit 9c981c8

Please sign in to comment.