We work from a clean checkout to ensure that everything you are adding to the build is what is in VC and doesn’t contain any of your uncommitted changes. It also ensure that someone else could replicate your process.
$ git clone git@github.com:translate/translate.git translate-release
$ cd translate-release
$ git submodule update --init
The release notes will be used in these places:
We create our release notes in reStructured Text, since we use that elsewhere and since it can be rendered well in some of our key sites.
First we need to create a log of changes in the Translate Toolkit, which is done generically like this:
$ git log $previous_version..HEAD > docs/release/$version.rst
Or a more specific example:
$ git log 1.10.0..HEAD > docs/releases/1.11.0-rc1.rst
Edit this file. You can use the commits as a guide to build up the release notes. You should remove all log messages before the release.
Note
Since the release notes will be used in places that allow linking we use links within the notes. These should link back to products websites (Virtaal, Pootle, etc), references to Translate and possibly bug numbers, etc.
Read for grammar and spelling errors.
Note
When writing the notes please remember:
We create a list of contributors using this command:
$ git log 1.10.0..HEAD --format='%aN, ' | awk '{arr[$0]++} END{for (i in arr){print arr[i], i;}}' | sort -rn | cut -d\ -f2-
After updating the release notes for the about to be released version, it is necessary to add new release notes for the next release, tagged as dev.
Update the version number in:
In __version__.py, bump the build number if anybody used the toolkit with the previous number, and there have been any changes to code touching stats or quality checks. An increased build number will force a toolkit user, like Pootle, to regenerate the stats and checks.
For conf.py change version and release
Todo
FIXME - We might want to consolidate the version and release info so that we can update it in one place.
The version string should follow the pattern:
$MAJOR-$MINOR-$MICRO[-$EXTRA]
E.g.
1.10.0
0.9.1-rc1
$EXTRA is optional but all the three others are required. The first release of a $MINOR version will always have a $MICRO of .0. So 1.10.0 and never just 1.10.
Building is the first step to testing that things work. From your clean checkout run:
$ mkvirtualenv build-ttk-release
(build-ttk-release)$ pip install -r requirements/dev.txt
(build-ttk-release)$ make build
(build-ttk-release)$ deactivate
$ rmvirtualenv build-ttk-release
This will create a tarball in dist/ which you can use for further testing.
Note
We use a clean checkout just to make sure that no inadvertant changes make it into the release.
The easiest way to test is in a virtualenv. You can test the installation of the new toolkit using:
$ mkvirtualenv test-ttk-release
(releasing)$ pip install path/to/dist/translate-toolkit-$version.tar.bz2
You can then proceed with other tests such as checking:
Documentation is available in the package
Converters and scripts are installed and run correctly:
(test-ttk-release)$ moz2po --help
(test-ttk-release)$ php2po --version
(test-ttk-release)$ deactivate
$ rmvirtualenv test-ttk-release
Meta information about the package is correct. This is stored in setup.py, to see some options to display meta-data use:
$ ./setup.py --help
Now you can try some options like:
$ ./setup.py --name
$ ./setup.py --version
$ ./setup.py --author
$ ./setup.py --author-email
$ ./setup.py --url
$ ./setup.py --license
$ ./setup.py --description
$ ./setup.py --long-description
$ ./setup.py --classifiers
The actual descriptions are taken from translate/__init__.py.
You should only tag once you are happy with your release as there are some things that we can’t undo. You can safely branch for a stable/ branch before you tag.
$ git checkout -b stable/1.10.0
$ git push origin stable/1.10.0
$ git tag -a 1.10.0 -m "Tag version 1.10.0"
$ git push --tags
Note
You need a username and password on Python Package Index (PyPI) and have rights to the project before you can proceed with this step.
These can be stored in $HOME/.pypirc and will contain your username and password. A first run of:
$ ./setup.py register
will create such file. It will also actually publish the meta-data so only do it when you are actually ready.
To test before publishing run:
$ make test-publish-pypi
Then to actually publish:
$ make publish-pypi
You will need:
Note
You need to have release permissions on sourceforge to perform this step.
You will need:
These are the steps to perform:
We need a tagged release before we can do this. The docs are published on Read The Docs.
Use the admin pages to flag a version that should be published
Todo
FIXME we might need to do this before publishing so that we can update doc references to point to the tagged version as apposed to the latest version.
We use github pages for the website. First we need to checkout the pages:
$ git checkout gh-pages
If you have created a staged release folder, then unstage it now.
Let people know that there is a new version:
These are tasks not directly related to the releasing, but that are nevertheless completely necessary.
Now that we’ve release lets make sure that master reflect the current state which would be {N+1}-alpha1. This prevents anyone using master being confused with a stable release and we can easily check if they are using master or stable.
Some possible cleanup tasks:
We also need to check and document these if needed: