Release procedure
=================

This release procedure is for the 0.5 series of elisa, based on the upicek
branch (``lp:~elisa-developers/elisa/upicek``).

It is however generic enough so that the relevant steps can be applied to any
other branch.

Requirements:

- A good understanding of what a release of Elisa is about;
- Some time (~ two hours to do it fully and properly).


Overture
--------

Branch ``upicek`` into a local branch with the new version number for name.
E.g.:

::

    $ bzr branch lp:~elisa-developers/elisa/upicek 0.5.n
    $ cd 0.5.n

It is recommended to commit to this branch after each step of the release
procedure so that changes are easy to track and/or revert if necessary.

Update ``elisa-core/elisa/core/__init__.py`` with the new version number, e.g.:

::

    $ sed -i 's/(0, 5, m, 1)/(0, 5, n)/' elisa-core/elisa/core/__init__.py
    $ bzr commit

If the release is a brown-paper-bag release, the nano component of the
version should be set to 1. For each consecutive brown-paper-bag
release the nano needs to be bumped. For "normal" releases the nano
can be removed as shown above.

Update the version number accordingly in the egg info:

::

    $ python elisa-core/setup.py egg_info
    $ bzr commit

Find a [cool|stupid|meaningful] release name.

Update the DOAP file (``elisa-core/elisa.doap``): add a new entry at the end
with the new release. Commit.

Update the splash screen images (the new ones should have been generated by
David). Commit.

- ``elisa-core/elisa/core/data/splash.png``
- ``elisa-core/elisa/core/data/splash_screen_square.png``

Add the new plugins if there are some to the corresponding bundles. Commit.

- ``elisa-core/setup-bundle-plugins-good.py``
- ``elisa-core/setup-bundle-plugins-bad.py``
- ``elisa-core/setup-bundle-plugins-ugly.py``

Update ``elisa-core/README`` with the potential new dependencies. Commit.

Make sure that all ``setup.py`` files in the newly added plugins are complete,
in particular that the ``package_data`` entry covers all the data files
(\*.png, \*.svg, \*.xml, \*.po, \*.pot, \*.mo, ...).

Make sure that the egg information is generated for all new plugins. If not:

::

    $ python elisa-plugins/elisa/plugins/<plugin>/setup.py egg_info -e elisa-plugins/
    $ bzr commit

Check for/fix Python 2.4 invalid syntax (e.g. ``yield`` without a value).
Commit.

**TODO:** use a tool for this.

Update ``elisa-core/NEWS`` with a new entry for the new release at the top of
the file. Commit.

- New features: free text inspired from the list of blueprints implemented in
  the milestone corresponding to the release.
- Bugs fixed: list of bugs fixed in the milestone, copy-pasted from Launchpad
  (**TODO:** write a script that scraps the milestone page and extracts the
  relevant information).

Update ``elisa-core/RELEASE``, replacing the previous release with the new one
with the lists of new features and bugs fixed from ``elisa-core/NEWS``.
Update the list of contributors at the end of the file. Commit.

Tag the release. E.g.:

::

    $ bzr tag release-0.5.n

Push this branch to launchpad:

::

    $ bzr push --remember lp:~elisa-developers/elisa/0.5.n


Tarballs
--------

Build the API documentation:

::

    $ python elisa-core/builddoc.py

Build the tarball for elisa core (the tarball will be put in
``elisa-core/dist/``):

::

    $ export PYTHONPATH=$PWD/elisa-core:$PWD/elisa-plugins:$PYTHONPATH
    $ cd elisa-core
    $ python setup.py sdist

Build the tarballs for the plugin bundles (the tarballs will be put in
``elisa-core/dist/``):

::

    $ ./make_bundles.sh

Test the tarballs (install, launch elisa, test quickly that the main
functionality is there and that the new ones work):

- make sure you don't have a system wide installation of elisa
- extract and install the core tarball
- extract and install the plugin bundles tarballs
  (good, bad, ugly, in that order)
- open up a new terminal, launch a pigment uninstalled shell, type ``elisa``

Once tested, upload the new tarballs to the web server:

::

    $ scp dist/*.tar.gz elisa@elisa01.bcn.fluendo.net:/var/www/elisa/static/download/elisa/


Bump the nano component of the version back to 1, so that the
development version can be distinguished from the release:

::

    $ sed -i 's/(0, 5, n)/(0, 5, n, 1)/' elisa-core/elisa/core/__init__.py
    $ bzr commit

If the release was not a brown-paper-bag release the nano needs to be set
to 1 as shown above. Otherwise it needs to be bumped in the case where
the release was brown-paper-bagged.

Windows installer
-----------------

There should be an automatic build entry for the branch of the new release
(see with Joshua to create it).

Go to http://elisa04.bcn.fluendo.net:8010/builders/0.5.n and click
``Force Build``.

Go to http://elisa04.bcn.fluendo.net:8010/waterfall to see the status of the
build (refresh the page periodically).

Once the build is done, you can grab the installer on the samba share of the
build bot:

::

    $ smbget -a smb://aetos/builds/windows/setup-YYYYMMDD-0.5.n-[rev]-[ddrev].exe -o elisa-mediacenter-0.5.n.exe

Test the installer on a windows machine (install, test quickly that the main
functionality is there and that the new ones work).

Once tested, upload the installer to the web server:

::

    $ scp elisa-mediacenter-0.5.n.exe elisa@elisa01.bcn.fluendo.net:/var/www/elisa/static/download/elisa/windows/


Website
-------

Upload the new API documentation:

::

    $ cd ..
    $ scp docs/api/* elisa@elisa01.bcn.fluendo.net:/var/www/elisa/static/documentation/api/

Log in to the web server:

::

    $ ssh elisa@elisa01.bcn.fluendo.net
    $ cd /var/www/elisa/django/elisaweb

Update the download page (``download/templates/download.html``):

- Version number (grep for it);
- Links to the windows installer;
- ``tarballs`` section at the bottom of the page.

Update the home page (``home/templates/home.html``) with the link to the new
windows installer in the piece of javascript code at the beginning of the file.

Update the upgrade script (``updates/views.py``). Around the end of the file,
update:

- ``current_released_version``
- ``installer_url``


Communication
-------------

Update the topic on the IRC channel (``#elisa@freenode``).

Send out a release mail including the ``elisa-core/RELEASE`` file (see the
previous release mails for a template). It has to be sent to:

- elisa@lists.fluendo.com
- python-announce-list@python.org

Post a news item on the website to announce the new release (see the previous
news for a template): http://elisa.fluendo.com/admin/news/news/.


Launchpad
---------

Change the status of all the bugs marked as "Fix Committed" in the milestone to
"Fix Released".

Move all the remaining open bugs either to the next milestone or the 0.5.x
milestone.


PPA packages
------------

See the procedure at
http://elisa.fluendo.com/wiki/Distribution/LinuxPackages/Ubuntu.

**TODO:** improve and automate it.


Final
-----

Merge back the release branch into upicek:

::

    $ cd <local/path/to/upicek/>
    $ bzr pull # to have the latest version
    $ bzr merge lp:~elisa-developers/elisa/0.5.n
    $ bzr commit -m "Merged the 0.5.n release."
    $ bzr push

Last but not least, ping Lionel so that he organizes a release dinner.

