|
29 | 29 | - name: Install ${{ env.package }} |
30 | 30 | run: | |
31 | 31 | python -m pip install --upgrade pip |
32 | | - python -m pip install flake8 pytest pytest-cov pytest-pythonpath coverage |
| 32 | + python -m pip install flake8 pytest pytest-cov coverage |
33 | 33 | pip install -r requirements.txt |
34 | 34 | pip install . |
35 | 35 | - name: Lint with flake8 |
|
51 | 51 | - name: Install ${{ env.package }} |
52 | 52 | run: | |
53 | 53 | python -m pip install --upgrade pip |
54 | | - python -m pip install pytest pytest-cov pytest-pythonpath |
| 54 | + python -m pip install pytest pytest-cov |
55 | 55 | pip install -r requirements.txt |
56 | 56 | pip install . |
57 | 57 | - name: Make coverage badge for ${{ env.package }} |
|
60 | 60 | pytest --cov=$package --cov-report=xml |
61 | 61 | genbadge coverage -i coverage.xml -o $cov_badge_path |
62 | 62 | - name: Verify Changed files |
63 | | - uses: tj-actions/verify-changed-files@v17 |
| 63 | + uses: tj-actions/verify-changed-files@v12 |
64 | 64 | id: changed_files |
65 | 65 | with: |
66 | 66 | files: ${{ env.cov_badge_path }} |
|
77 | 77 | with: |
78 | 78 | github_token: ${{ secrets.github_token }} |
79 | 79 | branch: ${{ github.ref }} |
| 80 | + deploy: |
| 81 | + runs-on: ubuntu-latest |
| 82 | + needs: coverage |
| 83 | + steps: |
| 84 | + - uses: actions/checkout@v3 |
| 85 | + with: |
| 86 | + fetch-depth: 0 |
| 87 | + - name: Check for version change |
| 88 | + uses: dorny/paths-filter@v2 |
| 89 | + id: filter |
| 90 | + with: |
| 91 | + filters: | |
| 92 | + version: |
| 93 | + - '**/VERSION.txt' |
| 94 | + - if: steps.filter.outputs.version == 'true' |
| 95 | + name: Cleanup README |
| 96 | + run: | |
| 97 | + sed -ri 's/^(##*)\s*:.*:\s*/\1 /g' README.md |
| 98 | + awk '{if (match($0,"## Supporters")) exit; print}' README.md > README |
| 99 | + mv -f README README.md |
| 100 | + - if: steps.filter.outputs.version == 'true' |
| 101 | + name: Build ${{ env.package }} package |
| 102 | + run: python3 -m pip install --upgrade build && python3 -m build |
| 103 | + - if: steps.filter.outputs.version == 'true' |
| 104 | + name: Upload ${{ env.package }} to PyPi |
| 105 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 106 | + with: |
| 107 | + password: ${{ secrets.PYPI_API_TOKEN }} |
| 108 | + verbose: true |
| 109 | + verify_metadata: false |
0 commit comments