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