Fixed bumpversion #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Python Package | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [closed] | |
branches: | |
- main | |
jobs: | |
deploy: | |
if: >- | |
(github.event_name == 'push' || | |
(github.event_name == 'pull_request' && github.event.pull_request.merged == true)) && | |
github.event.head_commit.author.email != '[email protected]' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build bump2version | |
- name: Bump version | |
run: | | |
bump2version --config-file .bumpversion.cfg --allow-dirty --verbose minor | |
- name: Commit and push changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Bump minor version [skip ci]" | |
git push | |
- name: Build package | |
run: python -m build | |
- name: Publish package | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |