updated scripts and notes for releasing
[monkeysphere.git] / utils / build-releasenote
1 #!/bin/bash
2
3 # script to build a release announcement for the Monkeysphere
4 # if you're running this, you probably also want to read through
5 # the checklist in utils/preparing-release.
6
7 # Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
8 # Copyright: © 2008-2010
9 # License: GPL, v3 or later
10
11 VERSION=`head -n1 Changelog | sed 's/.*(\([^)]*\)).*/\1/'`
12 WEBSITEDIR=../monkeysphere-docs/website
13
14 if [ ! -d "$WEBSITEDIR" ]; then
15     echo "you need to check out the monkeysphere-docs git repo" >&2
16     echo "as a peer of this repository to create a releasenote" >&2
17     exit 1
18 fi
19
20
21     sed "s/__VERSION__/$VERSION/g" < utils/releasenote.header
22     head -n$(( $(grep -n '^ --' Changelog  | head -n1 | cut -f1 -d:) - 2 )) Changelog | tail -n+3
23     sed "s/__VERSION__/$VERSION/g" < utils/releasenote.footer
24 } > "$WEBSITEDIR/news/release-$VERSION.mdwn"
25
26 (cd "$WEBSITEDIR" && git add "news/release-$VERSION.mdwn" )
27
28 checksums() {
29     echo "checksums for the monkeysphere ${VERSION%%-*} release:"
30     echo
31     echo "MD5:"
32     md5sum "../monkeysphere_${VERSION%%-*}.orig.tar.gz"
33     echo
34     echo "SHA1:"
35     sha1sum "../monkeysphere_${VERSION%%-*}.orig.tar.gz"
36     echo
37     echo "SHA256:"
38     sha256sum "../monkeysphere_${VERSION%%-*}.orig.tar.gz"
39
40
41 checksums
42
43 temprelease=$(mktemp ${TMPDIR:-/tmp}/tmp.XXXXXXXXXX)
44 trap "rm -f $temprelease" EXIT
45 set -e
46 head -n$(( $(grep -n '^-----BEGIN PGP SIGNED MESSAGE-----$' "$WEBSITEDIR/download.mdwn" | head -n1 | cut -f1 -d:) - 1 )) "$WEBSITEDIR/download.mdwn" | \
47  sed -e 's|http://archive\.monkeysphere\.info/debian/pool/monkeysphere/m/monkeysphere/monkeysphere_[[:digit:].]\+\.orig\.tar\.gz|http://archive.monkeysphere.info/debian/pool/monkeysphere/m/monkeysphere/monkeysphere_'"${VERSION%%-*}"'.orig.tar.gz|g' >$temprelease
48 checksums | gpg --no-tty --clearsign --default-key EB8AF314 >>$temprelease
49 cat utils/download.mdwn.footer >>$temprelease
50 mv "$temprelease" "$WEBSITEDIR/download.mdwn"
51 trap - EXIT
52 set +e
53
54 (cd "$WEBSITEDIR" && git add "download.mdwn")
55
56 gpg --verify "$WEBSITEDIR/download.mdwn"
57
58 printf "please remember to add the new version to the bugtracker:\n  https://labs.riseup.net/code/projects/settings/monkeysphere\n"