Skip to content
Sam Stavinoha edited this page Sep 9, 2015 · 24 revisions

Cutting a release

0. Find out what changes/commits you are releasing

This will allow you to increment the version appropriately.

Run

git fetch --all --tags
git tag --list | grep '^v' | sort -r

to lookup the most recent release.

The following assumes you have a remote called upstream pointing to github.com/checkmate/simpl. Once you know what the most recent release was, for example v0.3.1 run:

git log --no-merges --date=short --pretty="%h - %ad - %s - %an" v0.3.1..upstream/master

This will show you the list of commits you're about to release, and you'll be able to choose a major, minor, or patch release. Take note of these commits and messages, you'll copy them into the description of the pull request you're about to create.

1. Create a pull-request to bump the version

Bump the version number (the __version__ variable) in simpl/__about__.py.

https://github.com/checkmate/simpl/compare

Semantic versioning rule(s) of thumb:

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes,
MINOR version when you add functionality in a backwards-compatible manner, and
PATCH version when you make backwards-compatible bug fixes.

Go to step 2 once your "bump version" PR is merged into checkmate/simpl@master

2. Re-pull master to ensure you are publishing the commit that is equivalent to checkmate/simpl@master

You could verify this by running:

git ls-remote https://github.com/checkmate/simpl master
git rev-parse HEAD

Making sure that the commit hashes are the same.

3. Run the upload command thru setup.py to publish a source distribution and a universal wheel

You need to be a maintainer of simpl on PyPI with your ~/.pypirc configured in order to run the following command:

python setup.py sdist bdist_wheel upload

Your ~/.pypirc should probably look like this:

[distutils]
index-servers =
    pypi

[pypi]
username: <pypi_username>
password: <pypi_password>

See https://docs.python.org/2/distutils/packageindex.html#the-pypirc-file for more details on the .pypirc file.

4. Create a release through the GitHub UI:

Go here: https://github.com/checkmate/simpl/releases/new

Check the This is a pre-release box since you will need to edit and verify your release later. Click Publish release. This will create the new tag. Prefix the new version tag with a v, e.g. v0.1.9

5. Generate a changelog

As seen here: https://github.com/checkmate/simpl/releases/tag/v0.4.0

Run these commands to generate the changelog:

git fetch --all --tags
git log --date=short --no-color \
  --pretty=format:'%h :heavy_minus_sign: %s :small_blue_diamond: %an' \
  <previous_version_tag>..<new_version_tag>

6. Go back to the release you published at https://github.com/checkmate/simpl/releases and paste the changelog into the release description.

Also include a link to the package version on PyPI in the release description. e.g. https://pypi.python.org/pypi/simpl/0.4.0

The previous published release through GitHub was a "pre-release" if you checked the box, so change this to a final release (by un-checking the pre-release box) once you have verified that you can install the latest version by running

pip install -U simpl
python -c 'import simpl;print(simpl.__version__)'