Automating the release process for Maemo applications

Releasing a Maemo application to the Extras-devel repository is a rather simple operation, yet it can be a bit time consuming and one can always make small mistakes which, although always easily recoverable, again lead to a waste of time.

The release process typically consists of:

  1. cleaning the source tree from all unwanted files (built binary objects, editor backup copies, core-dumps and what not)
  2. building the debian package, which involves remembering the command to be used, typically something like dpkg-buildpackage -rfakeroot -sa -us -uc -i -I.git
  3. uploading the resulting files to the Maemo build robot, according to one of the methods described here
Although none of these steps is especially difficult, there are several things that can go wrong or that can make the process annoying:
  • you can easily forget to delete core dumps and other temporary files from the source tree, which might even contain sensitive information
  • remembering (or looking up in the shell history) the command for building the package
  • if you use the Extras Assistant you'll be dealing with a comfortable tool, but not as fast as the command line
  • if you have already made several releases and didn't delete the old files, you'll have to browse through them to find the latest version
The solution I've come up with is this simple script:
#! /bin/sh

set -e

BASEDIR="$(mktemp -d)"

git clone --depth 1 -l "$HOME/git/maemo-mapper"
cd maemo-mapper
git checkout origin/fremantle

dpkg-buildpackage -rfakeroot -sa -us -uc -i -I.git

cd ..
scp *.tar.gz *.diff.gz *.changes *.dsc

It's certainly not a script that you would find in a shell programming manual, but it does its job: first, it creates a temporary directory, then it clones the local git repository (which ensures that there won't be any unwanted files in the tree), then it selects the desired branch (if it's not the master branch), builds the package and uploads it to the builder. If any of these steps fail, the script terminates. Feel free to adapt it to your needs and use for your own releasing pleasure. :-)

As a side note, I've used it just now to release maemo-mapper 3.0+beta4, which doesn't include any remarkable features but comes with a redesign of the menus which are now drawn in the maemo5 style.


There's also webmention support.