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?

   Also check that the following Makefile targets work:

    Unix: all doc/monotone.pdf doc/monotone.ps distcheck

    Win32 MinGW: all check win32-installer

    Win32 Cygwin: all check dist-gzip


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://wiki.monotone.ca/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-<whatever>.tar.bz2 is ready for distribution".  If it
   bombs out, fix it, otherwise, SOMEDIR/monotone-<NEW VERSION>.tar.bz2
   is the source package.

10) Build docs for the website:

    $ tar xvzf SOMEDIR/monotone-<NEW VERSION>.tar.bz2
    $ 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.bz2 <NEW VERSION>/
    $ scp -r <NEW VERSION> mtn-uploads@monotone.ca:~/

    # The rest is done via monotone.
    #
    $ mtn -d DATABASE co -b net.venge.monotone.web.mainsite WEBDIR
    $ cp monotone-<NEW VERSION>/{NEWS,INSTALL,UPGRADE,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) Check if the releases newsfeed is properly updated, i.e. if the script
    <http://www.monotone.ca/releases.xml.php> can parse the NEWS file as is
    and links issues and URLs, while keeping the overall structure.
    (If your NEWS entries match the previous ones, this shouldn't be a problem.)

    If you encounter problems, either patch the NEWS file or adapt the code
    in releases.xml.php and commit your changes accordingly.

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) Append ".90" to the released version number in configure.ac to
    mark the beginning of the development of the next version of
    monotone.  For more information, read up the paragraph
    "Version numbering scheme" on <http://wiki.monotone.ca/RoadMap>
   
    Commit and sync your changes.

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

20) Party!
