|
1 | | -# This workflows will upload a Python Package using Twine when a release is created |
2 | | -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries |
3 | | - |
4 | | -name: Upload Python Package |
| 1 | +name: Python package build and publish |
5 | 2 |
|
6 | 3 | on: |
7 | | - push: |
8 | | - branches: |
9 | | - - master |
| 4 | + release: |
| 5 | + types: [created] |
10 | 6 |
|
11 | 7 | jobs: |
12 | 8 | deploy: |
13 | | - |
14 | 9 | runs-on: ubuntu-latest |
15 | | - |
16 | 10 | steps: |
17 | 11 | - uses: actions/checkout@v2 |
18 | 12 | - name: Set up Python |
19 | | - uses: actions/setup-python@v2 |
| 13 | + uses: actions/setup-python@v1 |
20 | 14 | with: |
21 | | - python-version: '3.x' |
| 15 | + python-version: 3.8 |
22 | 16 | - name: Install dependencies |
23 | 17 | run: | |
24 | | - pip install -r requirements.txt |
25 | 18 | python -m pip install --upgrade pip |
26 | | - pip install setuptools wheel twine |
27 | | - - name: Build and publish |
| 19 | + pip install twine flake8 |
| 20 | + - name: Lint with flake8 for syntax errors |
| 21 | + run: | |
| 22 | + pip install flake8 |
| 23 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 24 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 25 | + - name: Build manylinux Python wheels |
| 26 | + uses: RalfG/python-wheels-manylinux-build@v0.2.2-manylinux2010_x86_64 |
| 27 | + with: |
| 28 | + python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38' |
| 29 | + build-requirements: 'cython numpy scipy scikit-learn' |
| 30 | + system-packages: '' |
| 31 | + package-path: '' |
| 32 | + pip-wheel-args: '--no-deps' |
| 33 | + - name: Publish wheels to PyPI |
28 | 34 | env: |
29 | 35 | TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
30 | 36 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
31 | 37 | run: | |
32 | | - python setup.py sdist bdist_wheel |
33 | | - twine upload dist/* |
| 38 | + twine upload wheelhouse/*-manylinux*.whl |
0 commit comments