Skip to content

Commit 728d8db

Browse files
committed
Updated GitHub workflow
1 parent ea785d3 commit 728d8db

2 files changed

Lines changed: 33 additions & 40 deletions

File tree

.github/workflows/pypi-publish.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/python-package.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Install ${{ env.package }}
3030
run: |
3131
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
3333
pip install -r requirements.txt
3434
pip install .
3535
- name: Lint with flake8
@@ -51,7 +51,7 @@ jobs:
5151
- name: Install ${{ env.package }}
5252
run: |
5353
python -m pip install --upgrade pip
54-
python -m pip install pytest pytest-cov pytest-pythonpath
54+
python -m pip install pytest pytest-cov
5555
pip install -r requirements.txt
5656
pip install .
5757
- name: Make coverage badge for ${{ env.package }}
@@ -60,7 +60,7 @@ jobs:
6060
pytest --cov=$package --cov-report=xml
6161
genbadge coverage -i coverage.xml -o $cov_badge_path
6262
- name: Verify Changed files
63-
uses: tj-actions/verify-changed-files@v17
63+
uses: tj-actions/verify-changed-files@v12
6464
id: changed_files
6565
with:
6666
files: ${{ env.cov_badge_path }}
@@ -77,3 +77,33 @@ jobs:
7777
with:
7878
github_token: ${{ secrets.github_token }}
7979
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

Comments
 (0)