Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
33 changes: 2 additions & 31 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
----

Expand Down
Loading