This describes what to do for an release!


== Cleanup ==


For the first few steps you have to work on branch master:
 git-checkout master

If any feature branch is left over merge it:
 git-merge --no-ff feature

And now commit everything:
 git-commit -a

Clean up the mess left over:
 git-clean -df


== Check ==

Try to move as much as possible from this manual checks to build-server!

Before release is done, following must be checked:
- Everything blue on http://community.markus-raab.org:8080/
- Version number in CMakeLists.txt
- using installed debian packages, run:
 - (installed executeable tests
 - API/ABI compatible by running old tests
 - (installed) shell tests
 - if tests cases do not remove existing config
 - if external compilation works
 - if API/ABI compatible


== Preperation ==

Set environment variable VERSION to current version to make the
commands below work for copy&paste:

 export VERSION=0.x.y


== Source Package ==

Now lets merge that to the release branch:
 git-checkout release
 git-merge --no-ff master
 git-commit --amend -m "Release $VERSION"

Build tar.gz and tag version and make hashsum:
 cd ~build && make source-package

TODO: write script for that (+ merge with source-package)
Unpack + compile (with all available plugins) + test those sources (using valgrind!):
tar xvzf elektra-$VERSION.tar.gz && mkdir build && cd build && cmake -DPLUGINS=ALL ../elektra-$VERSION && make && ctest -T memcheck

Now copy the packages to ftp (stay in same folder):
 cp ~build/elektra-$VERSION.tar.gz ~elektra-ftp/releases
 cp ~build/elektra-$VERSION.tar.gz.hashsum ~elektra-ftp/releases

Commit elektra-ftp to gitorious:
 cd ~elektra-ftp
 git-add releases/elektra-$VERSION.tar.gz
 git-add releases/elektra-$VERSION.tar.gz.hashsum
 git-commit -a -m "Release $VERSION"


== Documentation ==

And the API docu (stay in same folder):
 mkdir ~elektra-doc/api/$VERSION/
 cd ~build && make doc && cp -ra doc/html doc/latex doc/man ~elektra-doc/api/$VERSION/

Symlink current to latest version and add everything:
 cd ~elektra-doc/api/ && rm current && ln -s $VERSION current && git-add current $VERSION



== Debian Package ==


Build deb:
 git-checkout debian
 git-merge --no-ff release

 dch --newversion $VERSION-1 "New upstream version."
 git-add debian/changelog
 git-commit -m "Debian Package $VERSION-1"
 git-tag $VERSION-1
 cp ~elektra-ftp/releases/elektra-$VERSION.tar.gz ~elektra/elektra_$VERSION.orig.tar.gz
 git-buildpackage -rfakeroot -k00B86A15 -sa
 reprepro --ignore=wrongdistribution include wheezy elektra_$VERSION-1_amd64.changes


Now install package + run some basic commands:
 kdb --version

Debian packages in chroot + publish in reprepro

You might want to run lintian:
 lintian -EI --color=auto --pedantic elektra_$VERSION-1_i386.changes

And also run piuparts:
 sudo piuparts elektra_$VERSION-1_i386.changes

And run adequate (combined with piuparts or after installation)


== Publish ==


Now we know that everything worked well:

Now push release branch with tags to gitorious:
 cd ~e && git-pull && git-push && git-push --tags

Push elektra-ftp to gitorious:
 cd ~elektra-ftp && git-push && git-push gitorious

Push elektra-doc to gitorious:
 cd ~elektra-doc && git-commit -a -m "$VERSION Release" && git-push


== Announce ==

Write NEWS for new release (do not forget to add links where to download release):
 editor doc/NEWS

Finally increment version number in CMakeLists.txt:
 editor CMakeLists.txt
 git-commit -m "Ready for release $VERSION" CMakeLists.txt

Maybe also generate a ChangeLog?
 git log --first-parent master > ChangeLog


Finally check links and send out mail to list
(Personal notice: see also NOTIFY)
