File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22current_version = 0.1.8
33commit = True
44tag = True
5- message = " Bump version: {current_version} → {new_version} [skip ci ]"
5+ message = " Bump version: {current_version} → {new_version} [publish ]"
66
77[bumpversion:file:setup.py]
88search = version =" {current_version}"
Original file line number Diff line number Diff line change 77
88jobs :
99 publish :
10- if : github.actor != 'github-actions[bot]'
10+ if : github.actor != 'github-actions[bot]' && contains(github.event.head_commit.message, '[publish]')
1111 runs-on : ubuntu-latest
1212
1313 permissions :
@@ -28,40 +28,11 @@ jobs:
2828 - name : Install dependencies
2929 run : |
3030 python -m pip install --upgrade pip
31- pip install setuptools wheel twine bump2version
32-
33- - name : Configure Git
34- run : |
35- git config --global user.email "grafuls@gmail.com"
36- git config --global user.name "Your Name"
37-
38- - name : Bump version
39- run : |
40- # Keep bumping until we find a version without an existing tag
41- for i in {1..10}; do
42- NEW_VERSION=$(bump2version --dry-run --list patch | grep new_version | sed -r 's/^.*=//')
43- if git rev-parse "v${NEW_VERSION}" >/dev/null 2>&1; then
44- echo "Tag v${NEW_VERSION} already exists, bumping past it..."
45- bump2version patch --no-tag --no-commit --allow-dirty
46- else
47- echo "Bumping to v${NEW_VERSION}"
48- bump2version patch
49- break
50- fi
51- done
31+ pip install setuptools wheel twine
5232
5333 - name : Build package
5434 run : python setup.py sdist bdist_wheel
5535
56- - name : Sync changes with all branches
57- run : |
58- git checkout latest
59- git pull origin latest --rebase
60- git push origin latest
61- git checkout development
62- git merge latest
63- git push origin development
64-
6536 - name : Publish package
6637 env :
6738 TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
Original file line number Diff line number Diff line change @@ -73,6 +73,16 @@ For merging, you should:
73733. Add a note to ``CHANGELOG.rst `` about the changes.
74744. Add yourself to ``AUTHORS.rst ``.
7575
76+ Release Process
77+ ===============
78+
79+ To release a new version, run the following command::
80+
81+ bumpversion patch
82+
83+ This will increment the version number and commit the changes.
84+
85+
7686Tips
7787----
7888
You can’t perform that action at this time.
0 commit comments