1919 fail-fast : false
2020 matrix :
2121 os : [ubuntu-latest]
22- python-version : ["3.8 ", "3.9 ", "3.10 ", "3.11 ", "3.12 "]
22+ python-version : ["3.9 ", "3.10 ", "3.11 ", "3.12 ", "3.13 "]
2323 steps :
2424 - uses : actions/checkout@v3
2525 - name : Set up Python ${{ matrix.python-version }}
@@ -31,11 +31,12 @@ jobs:
3131 - name : Install ${{ env.package }}
3232 run : |
3333 python -m pip install --upgrade pip
34- python -m pip install pytest pytest-cov pytest-pythonpath coverage
34+ python -m pip install pytest pytest-cov coverage
3535 pip install -r requirements.txt
3636 pip install .
3737 - name : Test ${{ env.package }} with pytest
3838 run : |
39+ export PYTHONPATH=$PYTHONPATH:$(pwd)/../tests/
3940 pytest --cov=$package
4041 coverage :
4142 needs : build
@@ -47,18 +48,19 @@ jobs:
4748 - name : Set up Python ${{ matrix.python-version }}
4849 uses : actions/setup-python@v4
4950 with :
50- python-version : " 3.10 "
51+ python-version : " 3.12 "
5152 - name : Install pandoc
5253 run : sudo apt-get install -y pandoc notification-daemon
5354 - name : Install ${{ env.package }}
5455 run : |
5556 python -m pip install --upgrade pip
56- python -m pip install pytest pytest-cov pytest-pythonpath
57+ python -m pip install pytest pytest-cov
5758 pip install -r requirements.txt
5859 pip install .
5960 - name : Make coverage badge for ${{ env.package }}
6061 run : |
6162 pip install genbadge[coverage]
63+ export PYTHONPATH=$PYTHONPATH:$(pwd)/../tests/
6264 pytest --cov=$package --cov-report=xml
6365 genbadge coverage -i coverage.xml -o $cov_badge_path
6466 - name : Verify Changed files
7981 with :
8082 github_token : ${{ secrets.github_token }}
8183 branch : ${{ github.ref }}
84+ deploy :
85+ runs-on : ubuntu-latest
86+ needs : coverage
87+ steps :
88+ - uses : actions/checkout@v3
89+ with :
90+ fetch-depth : 0
91+ - name : Check for version change
92+ uses : dorny/paths-filter@v2
93+ id : filter
94+ with :
95+ filters : |
96+ version:
97+ - '**/VERSION.txt'
98+ - if : steps.filter.outputs.version == 'true'
99+ name : Cleanup README
100+ run : |
101+ sed -ri 's/^(##*)\s*:.*:\s*/\1 /g' README.md
102+ awk '{if (match($0,"## Supporters")) exit; print}' README.md > README
103+ mv -f README README.md
104+ - if : steps.filter.outputs.version == 'true'
105+ name : Build ${{ env.package }} package
106+ run : python3 -m pip install --upgrade build && python3 -m build
107+ - if : steps.filter.outputs.version == 'true'
108+ name : Upload ${{ env.package }} to PyPi
109+ uses : pypa/gh-action-pypi-publish@release/v1
110+ with :
111+ password : ${{ secrets.PYPI_API_TOKEN }}
112+ verbose : true
113+ verify_metadata : false
0 commit comments