Skip to content

Python package build and publish (Linux) #32

Python package build and publish (Linux)

Python package build and publish (Linux) #32

name: Python package build and publish (Linux)
on: workflow_dispatch
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine flake8 build
- name: Lint with flake8 for syntax errors
run: |
pip install flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build Python source distribution
run: |
python -m build --sdist --outdir dist/ .
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.7.1
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
pip-wheel-args: '-w ./dist --no-deps'
- name: Publish wheels to PyPI
continue-on-error: true
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*.tar.gz
twine upload dist/*-manylinux*.whl