1- name : Development Pypi
1+ name : Development PyPI
2+
23on :
34 push :
45 tags :
56 - " *-*"
7+
68jobs :
79 testing-deploy :
8- name : Pypi
10+ name : PyPI
911 runs-on : ubuntu-latest
1012 environment :
1113 name : pypi
@@ -14,39 +16,44 @@ jobs:
1416 id-token : write
1517
1618 steps :
17- - uses : actions/checkout@v2
19+ - name : Check out repository
20+ uses : actions/checkout@v3
1821
1922 - name : Set up Python
20- uses : actions/setup-python@master
23+ uses : actions/setup-python@v4
2124 with :
2225 python-version : 3.9
2326
24- - name : Preparing the environment
27+ - name : Install dependencies
2528 run : |
2629 python -m pip install --upgrade pip
27- if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; else python -m pip install beautifulsoup4 requests pydantic expiringdict pytest; fi
30+ python -m pip install pip-tools
31+ pip install hatch pytest pytest-cov
32+ pip-compile pyproject.toml -o requirements-build.txt --all-extras
33+ pip install -r requirements-build.txt
2834
29- - name : Starting Testing Suites
35+ - name : Run tests
3036 run : |
31- ENMA_CACHING_STATE=disabled \
32- pytest ./tests
37+ ENMA_CACHING_STATE=disabled hatch run pytest
3338
34- - name : Upload Report to Codecov
35- uses : codecov/codecov-action@v1
39+ - name : Upload coverage report to Codecov
40+ uses : codecov/codecov-action@v3
3641 with :
3742 token : ${{ secrets.CODECOV_TOKEN }}
38- file : ./coverage.xml
43+ files : ./coverage.xml
3944 flags : pytest
4045
41- - name : Building and Deploying
46+ - name : Build the package
4247 run : |
43- python -m pip install build twine wheel setuptools_scm setuptools
44- python -m build
48+ hatch build
4549
4650 - name : Publish a Python distribution to PyPI
47- uses : pypa/gh-action-pypi-publish@v1.8.14
51+ uses : pypa/gh-action-pypi-publish@release/v1
4852 with :
4953 repository-url : https://test.pypi.org/legacy/
5054 user : __token__
5155 password : ${{ secrets.DEV_PYPI_API_TOKEN }}
52- packages_dir : dist/
56+ packages-dir : dist/
57+ verify-metadata : false
58+ attestations : false
59+ verbose : true
0 commit comments