diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2fd630..36871c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,14 +52,31 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install poetry - python -m pip install build twine + + - name: Bump version + run: | + # Get the current version + current_version=$(poetry version -s) + echo "Current version: $current_version" + + # Bump patch version + poetry version patch + new_version=$(poetry version -s) + echo "Bumped to version: $new_version" + + # Commit the version change + git config --global user.name 'GitHub Actions' + git config --global user.email 'actions@github.com' + git commit -am "Bump version to $new_version [skip ci]" + git push - name: Build and publish env: PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} run: | - # Build the package - python -m build + # Build the package using poetry + poetry build - # Publish to PyPI - python -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/* --username __token__ --password $PYPI_API_TOKEN \ No newline at end of file + # Publish to PyPI using poetry + poetry config pypi-token.pypi $PYPI_API_TOKEN + poetry publish