Skip to content

Commit

Permalink
Use pypa build instead of setup.py for python CD
Browse files Browse the repository at this point in the history
  • Loading branch information
figi44 committed May 29, 2024
1 parent ef30a03 commit c9ab6ee
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/cd-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install setuptools wheel twine build
- name: Check version
run: |
release=${{ github.ref_name }}
version=$(python setup.py --version)
test "$release" == "$version"
if [ -f "setup.py" ]; then
release=${{ github.ref_name }}
version=$(python setup.py --version)
test "$release" == "$version"
fi
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist
python -m build --sdist
twine upload dist/*

0 comments on commit c9ab6ee

Please sign in to comment.