|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a single version of Python |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 | + |
| 4 | +name: Publish to PyPI |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + tags: "*" |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + - name: Set up Python 3.9 |
| 18 | + uses: actions/setup-python@v2 |
| 19 | + with: |
| 20 | + python-version: 3.9 |
| 21 | + - name: Install dependencies |
| 22 | + run: | |
| 23 | + python -m pip install --upgrade pip |
| 24 | + pip install flake8 pytest tox |
| 25 | + # - name: Lint with flake8 |
| 26 | + # run: | |
| 27 | + # # stop the build if there are Python syntax errors or undefined names |
| 28 | + # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 29 | + # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 30 | + # # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 31 | + - name: Test with tox |
| 32 | + run: | |
| 33 | + tox |
| 34 | + - name: Build docs |
| 35 | + run: | |
| 36 | + tox -e docs |
| 37 | + - run: touch ./docs/_build/html/.nojekyll |
| 38 | + - name: GH Pages Deployment |
| 39 | + uses: JamesIves/github-pages-deploy-action@4.1.3 |
| 40 | + with: |
| 41 | + branch: gh-pages # The branch the action should deploy to. |
| 42 | + folder: ./docs/_build/html |
| 43 | + clean: true # Automatically remove deleted files from the deploy branch |
| 44 | + - name: Build Project and Publish |
| 45 | + run: | |
| 46 | + python -m tox -e clean,build |
| 47 | + - name: Publish package |
| 48 | + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 |
| 49 | + with: |
| 50 | + user: __token__ |
| 51 | + password: ${{ secrets.PYPI_PASSWORD }} |
0 commit comments