Skip to content

Commit f00fb16

Browse files
committed
CI: Modified release process
1 parent 207f87b commit f00fb16

3 files changed

Lines changed: 13 additions & 32 deletions

File tree

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
current_version = 0.1.8
33
commit = True
44
tag = 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]
88
search = version="{current_version}"

.github/workflows/publish.yml

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
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 }}

CONTRIBUTING.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ For merging, you should:
7373
3. Add a note to ``CHANGELOG.rst`` about the changes.
7474
4. 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+
7686
Tips
7787
----
7888

0 commit comments

Comments
 (0)