diff --git a/.bumpversion.cfg b/.bumpversion.cfg index b0b2f33..0028624 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -2,7 +2,7 @@ current_version = 0.1.8 commit = True tag = True -message = "Bump version: {current_version} → {new_version} [skip ci]" +message = "Bump version: {current_version} → {new_version} [publish]" [bumpversion:file:setup.py] search = version="{current_version}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cee962a..01a0ecc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,7 +7,7 @@ on: jobs: publish: - if: github.actor != 'github-actions[bot]' + if: github.actor != 'github-actions[bot]' && contains(github.event.head_commit.message, '[publish]') runs-on: ubuntu-latest permissions: @@ -28,40 +28,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine bump2version - - - name: Configure Git - run: | - git config --global user.email "grafuls@gmail.com" - git config --global user.name "Your Name" - - - name: Bump version - run: | - # Keep bumping until we find a version without an existing tag - for i in {1..10}; do - NEW_VERSION=$(bump2version --dry-run --list patch | grep new_version | sed -r 's/^.*=//') - if git rev-parse "v${NEW_VERSION}" >/dev/null 2>&1; then - echo "Tag v${NEW_VERSION} already exists, bumping past it..." - bump2version patch --no-tag --no-commit --allow-dirty - else - echo "Bumping to v${NEW_VERSION}" - bump2version patch - break - fi - done + pip install setuptools wheel twine - name: Build package run: python setup.py sdist bdist_wheel - - name: Sync changes with all branches - run: | - git checkout latest - git pull origin latest --rebase - git push origin latest - git checkout development - git merge latest - git push origin development - - name: Publish package env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 3173008..e53f504 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -73,6 +73,16 @@ For merging, you should: 3. Add a note to ``CHANGELOG.rst`` about the changes. 4. Add yourself to ``AUTHORS.rst``. +Release Process +=============== + +To release a new version, run the following command:: + + bumpversion patch + +This will increment the version number and commit the changes. + + Tips ----