How to release a new version of monotone
----------------------------------------

0) Send a pre-release announcement out to monotone-i18n@nongnu.org
   to inform active translators that a new version of monotone
   is about to be released and that their translations probably
   need to be updated. It might be useful to include the current
   statistics in this email:

   $ for file in $(ls po/*.po); do \
     echo -n "$file: " && msgfmt -cv $file; done

1) Make sure that the buildbot looks reasonably green.  Let's not
   release stuff that's known to be broken on any major platforms, eh?

2) Write user-readable release notes at the top of the NEWS file,
   roughly following the format of existing entries.  Make sure to
   mention any incompatibilities at the top, and generally it's a good
   idea to put cool new stuff above nice-but-not-as-exciting stuff.

   A useful command:

     $ mtn log --from h:net.venge.monotone --to t:monotone-*

   Commit your release notes, so other people can see them.

3) Get people to read over your release notes, it's really easy to
   make mistakes or have stupid grammatical errors here.

4) Check the NEWS if any changes in the automation interface have happened.

   Document changes in the wiki under http://monotone.ca/wiki/AutomateVersions/
   by adding new commands with an 'A' marker or set a 'B' (for _B_ackwards
   compatible change) or 'C' (for backwards in_C_ompatible change) markers for
   changed commands.

   Decide whether the interface version has to be bumped in the minor
   ('A' and 'B' changes) or major ('C' changes) number.

   Add the new interface version in cmd_automate.cc
   (static string 'interface_version').

   Verify that new / changed commands document their changes with the new
   interface version properly (look for "@item (Added in|Changes)" stanzas), if
   not, add the version numbers there.

   Commit your changes.

5) Update the UPGRADE file.  At the very least, bump the version
   number in the first line.  This file should always contain a
   complete description of how to upgrade from any version of monotone
   to the latest release -- you may need to tweak or remove earlier
   entries to keep this true.

   Commit your changes.

6) Double-check that INSTALL, AUTHORS, and README don't need any
   updates.  If they do, make them.

7) Update version numbers.  The following files need to be touched:
     configure.ac: change the call to AC_INIT
     visualc/config.h: the version number is mentioned several times,
       don't miss any.
   Commit your changes.

8) Okay, everything should be ready to go... double-check that:
     -- you've done the above steps correctly
     -- you've entered the correct date at the top of the NEWS file
        (esp. important when you wrote the notes a few days ago so
        people could look them over!)

9) Build and test the source package, in a clean checkout (if you use
   your main workspace, you increase the changes of accidentally
   picking up weird stuff):

   $ mtn co -r h:net.venge.monotone SOMEDIR
   $ cd SOMEDIR
   $ autoreconf -i && ./configure && make distcheck

   Wait a long time, eventually it will either bomb out, or say
   "monotone-0.<whatever>.tar.gz is ready for distribution".  If it
   bombs out, fix it, otherwise, SOMEDIR/monotone-<NEW VERSION>.tar.gz
   is the source package.

10) Build docs for the website:

    $ tar xvzf SOMEDIR/monotone-<NEW VERSION>.tar.gz
    $ cd monotone-<NEW VERSION>
    $ ./configure
    $ LANG=C make monotone.pdf html

11) Upload everything to the website (uses monotone):

    # This requires that you have registered a SSH version 2 public key
    # with the administrators of monotone.ca, currently richard@levitte.org.
    #
    $ mkdir <NEW VERSION>
    $ mv SOMEDIR/monotone-<NEW VERSION>.tar.gz <NEW VERSION>/
    $ scp -r <NEW VERSION> mtn-uploads@monotone.ca:downloads/

    # The rest is done via monotone.
    #
    $ mtn -d DATABASE co -b net.venge.monotone.web WEBDIR
    $ cp monotone-<NEW VERSION>/{NEWS,INSTALL,UPGRADE,README,monotone.pdf,monotone.html} \
          WEBDIR/
    $ rm -rf WEBDIR/docs
    $ cp -r monotone-<NEW VERSION>/html WEBDIR/docs

    Open WEBDIR/monotone.html, change the CSS include from "texinfo.css" to
    "docs/texinfo.css" and hit save.

    $ rm WEBDIR/figures/*
    $ cp monotone-<NEW VERSION>/figures/*.png WEBDIR/figures/
    $ cd WEBDIR
    $ mtn drop --missing
    $ mtn add --unknown
    $ mtn ci -m "Updates related to the release of monotone <NEW VERSION>"
    $ mtn sync

12) Update index.php on the website to state the latest version in the left
    column:

    $ cd WEBDIR
    $ vi index.php
    $ mtn ci -m "Updates related to the release of monotone <NEW VERSION>"
    $ mtn sync

13) Update releases.xml on the website so the RSS feed contains information
    for the newly released version. Don't forget to update the feed's
    global pubDate date as well as the invididual item's pubDate
    and ensure you use the correct datetime format. Add an <enclosure>
    which links to the monotone source tarball and add the proper length
    as attribute.
    Finally you should just copy'n'paste the NEWS entry for the NEW VERSION
    directly into the description inside a CDATA field and do a couple of
    searches and replaces to add HTML formatting for a nicer display.

    $ cd WEBDIR
    $ vi releases.xml
    $ mtn ci -m "Updates RSS feed for monotone <NEW VERSION>"
    $ mtn sync

14) Once you're pretty sure things have gone well, tag the source:

    $ mtn tag <REVISION> monotone-<NEW VERSION>

    This is the last possible moment to back out!

    $ mtn sync

15) Change the topic in the IRC channel to state the new version
    number.

16) Send out a release announcement.  Format is something like:

    To: monotone-announce@nongnu.org
    CC: monotone-devel@nongnu.org
    Subject: [ANNOUNCE] monotone <NEW VERSION> released

    <a few lines stating the new version and where the website is>

    <the release notes copy/pasted from the top of NEWS>

    <sign off>

17) Submit a release announcement to freshmeat.net.

18) Note any mistakes you made and update this file accordingly for
    next time.

19) Party!
