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/
- make sure no TODO is in this file (resolve them first!)



== Increment Version numbers ==

- CMakeLists.txt
- tests/shell/include_common.sh.in
- src/tools/gen/setup.py.in


= Preperation =

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

 export VERSION=0.x.y

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


== Prepare Source Package ==

Build tar.gz and tag version and make hashsum:
TODO: add -u 0B2F0DDC in release-tag signed-release-tag
 cd ~build && make 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 -j 5 && 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

TODO: ./check_get_set.sh:


== 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"
 cp ~elektra-ftp/releases/elektra-$VERSION.tar.gz ~elektra/elektra_$VERSION.orig.tar.gz
 git-buildpackage -rfakeroot -k0B2F0DDC -sa

Now move and install:
 cd ~elektra && mkdir deb/$VERSION && mv elektra_$VERSION* deb/$VERSION && mv *.deb deb/$VERSION && sudo dpkg -i deb/$VERSION/*.deb


Run some basic commands, at least:
 kdb --version

Debian packages in chroot + publish in reprepro

Now run lintian:
 lintian -EI --color=auto --pedantic deb/$VERSION/elektra_$VERSION-1_*.changes

And run piuparts:
 sudo piuparts deb/$VERSION/elektra_$VERSION-1_*.changes

And run adequate (combined with piuparts and after installation)
 adequate '*elektra*'

Install libelektra-test of the previous version and run:
 for i in `dpkg -L libelektra-test | grep bin`; do $i; done

TODO: remove set -x from shell tests
TODO: install shell scripts
TODO: usr/bin/check_* should be added, but needs modification of ENABLE_KDB_TESTING


== Test external tools ==


Check if tools based on elektra still do:
 dq


== 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




= Publish =

== Debian Package ==

 cd ~elektra/deb/$VERSION && reprepro --ignore=wrongdistribution include wheezy elektra_$VERSION-1_amd64.changes && update-reprepro

== Commit source package ==

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"


== push ==

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)
