Skip to content

Commit

Permalink
Merge pull request #74 from minrk/bump2version
Browse files Browse the repository at this point in the history
Adopt bump2version for automating version bumps
  • Loading branch information
consideRatio authored Nov 27, 2019
2 parents ac2fd8a + 99e1495 commit ba34a13
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 23 deletions.
19 changes: 19 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[bumpversion]
current_version = 0.4.4.dev
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z0-9]+))?
tag_name = {new_version}
allow_dirty = True
commit = True
tag = False
serialize =
{major}.{minor}.{patch}.{release}
{major}.{minor}.{patch}

[bumpversion:file:chartpress.py]

[bumpversion:part:release]
optional_value = stable
values =
dev
stable

3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ cache: pip
install:
- set -e
- pip install --upgrade pip
- pip install .
- pip install -r dev-requirements.txt
- pip install .
- pip freeze
- curl -L https://git.io/get_helm.sh | bash
- helm init --client-only

Expand Down
50 changes: 28 additions & 22 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,51 @@ For you to follow along according to these instructions, you need:
project](https://pypi.org/project/chartpress/).
- To have push rights to the [chartpress GitHub repository](https://github.com/jupyterhub/chartpress).

## Technical steps to make a release
## Steps to make a release

1. Checkout master and make sure it is up to date.
1. Update [CHANGELOG.md](CHANGELOG.md) if it is not up to date,
and verify [README.md](README.md) has an updated output of running `--help`.
Make a PR to review the CHANGELOG notes.

```
1. Once the changelog is up to date, checkout master and make sure it is up to date and clean.

```bash
ORIGIN=${ORIGIN:-origin} # set to the canonical remote, e.g. 'upstream' if 'origin' is not the official repo
git checkout master
git fetch <upstream> master
git reset --hard <upstream>/master
git fetch $ORIGIN master
git reset --hard $ORIGIN/master
# WARNING! This next command deletes any untracked files in the repo
git clean -xfd
```

1. Update [CHANGELOG.md](CHANGELOG.md) and verify [README.md](README.md) has an
updated output of running `--help`.

1. Set the `__version__` variable in [chartpress.py](chartpress.py)
appropriately and make a commit with message `release <tag>`.
1. Update the version with `bump2version` (can be installed with `pip install -r dev-requirements.txt`)

1. Create a git tag for the commit.

```
git tag -a <tag> -m <tag> HEAD
```bash
VERSION=... # e.g. 1.2.3
bump2version --tag --new-version $VERSION -
```

1. Package the release
```
python3 setup.py bdist_wheel

```bash
python3 setup.py sdist bdist_wheel
```

1. Upload it to PyPI
```
twine upload dist/chartpress-<tag>-py3-none-any.whl

```bash
twine upload dist/*
```

1. Reset the `__version__` variable in [chartpress.py](chartpress.py)
appropriately with a `.dev` appendix and make a commit with the message `back
to dev`.
1. Reset the version to the next development version with `bump2version`

```bash
bump2version --no-tag patch
```

1. Push your two commits to master along with the annotated tags referencing
commits on master.

```
git push --follow-tags <upstream> master
git push --follow-tags $ORIGIN master
```
3 changes: 3 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
bump2version
gitpython
pytest
pytest-flakes
twine
wheel

0 comments on commit ba34a13

Please sign in to comment.