diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 3df6fd7279..4bae59c5bb 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -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/cibuildwheel@v2.3.0 + 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/gh-action-pypi-publish@v1.4.2 + with: + user: ${{ secrets.pypi_user }} + password: ${{ secrets.pypi_password }}