1+ name : Publish on PyPi Workflow
2+ on : [push]
3+ jobs :
4+ build :
5+ runs-on : ubuntu-latest
6+ strategy :
7+ matrix :
8+ python-version : ['3.11']
9+
10+ steps :
11+ - uses : actions/checkout@v2
12+ - name : Set up Python ${{ matrix.python-version }}
13+ uses : actions/setup-python@v2
14+ with :
15+ python-version : ${{ matrix.python-version }}
16+ - name : Install dependencies
17+ run : |
18+ python -m pip install --upgrade pip
19+ pip install flake8 coverage
20+ pip install -r requirements.txt
21+ - name : Lint with flake8
22+ run : |
23+ pip install -e .
24+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
25+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
26+ - name : Test with unittest
27+ run : |
28+ python -m unittest discover -s ./async_include/tests
29+ - name : Generate the coverage report
30+ run : |
31+ coverage run --source=async_include/tests -m unittest
32+ coverage xml -o coverage.xml
33+ - name : Publish code coverage to code climate
34+ 35+ env :
36+ CC_TEST_REPORTER_ID : ${{secrets.CC_TEST_REPORTER_ID}}
37+ with :
38+ coverageCommand : coverage report
39+ - name : Create distribution package to PyPI
40+ run : |
41+ pip install pypandoc
42+ python setup.py sdist
43+ - name : Publish a Python distribution to PyPI
44+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
45+ uses : pypa/gh-action-pypi-publish@release/v1
46+ with :
47+ user : __token__
48+ password : ${{ secrets.DJANGO_ASYNC_INCLUDE_PYPI_API_TOKEN }}
0 commit comments