@@ -61,25 +61,28 @@ jobs:
6161 runs-on : ubuntu-latest
6262 steps :
6363 - uses : actions/checkout@v1
64- - name : Check For setup.py
64+ - name : Check For pyproject.toml
6565 id : need-pypi
6666 run : |
67- echo ::set-output name=setup-py ::$( find . -wholename './setup.py ' )
67+ echo ::set-output name=pyproject-toml ::$( find . -wholename './pyproject.toml ' )
6868 - name : Set up Python
69- if : contains(steps.need-pypi.outputs.setup-py , 'setup.py ')
69+ if : contains(steps.need-pypi.outputs.pyproject-toml , 'pyproject.toml ')
7070 uses : actions/setup-python@v2
7171 with :
7272 python-version : ' 3.x'
7373 - name : Install dependencies
74- if : contains(steps.need-pypi.outputs.setup-py , 'setup.py ')
74+ if : contains(steps.need-pypi.outputs.pyproject-toml , 'pyproject.toml ')
7575 run : |
7676 python -m pip install --upgrade pip
77- pip install setuptools wheel twine
77+ pip install --upgrade build twine
7878 - name : Build and publish
79- if : contains(steps.need-pypi.outputs.setup-py , 'setup.py ')
79+ if : contains(steps.need-pypi.outputs.pyproject-toml , 'pyproject.toml ')
8080 env :
8181 TWINE_USERNAME : ${{ secrets.pypi_username }}
8282 TWINE_PASSWORD : ${{ secrets.pypi_password }}
8383 run : |
84- python setup.py sdist
84+ for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
85+ sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file;
86+ done;
87+ python -m build
8588 twine upload dist/*
0 commit comments