release.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. if [ $# -ne 2 ] ; then
  3. echo "usage: $0 <quagga-release-tag> <quagga-previous-release-tag>"
  4. exit
  5. fi
  6. errmsg () {
  7. echo "Error occurred. To rerun you may first need to delete the tag".
  8. exit 1
  9. }
  10. trap errmsg ERR
  11. REL=${1:?Release version must be given as first argument!}
  12. PREV=${2:?Previous release version must be given as second argument!}
  13. TMPDIR=`mktemp -d /tmp/quagga-rel-XXXXXXXXX`
  14. if [ ! -d $TMPDIR ] ; then
  15. echo "Problem making temp directory ${TMPDIR}!"
  16. exit 1;
  17. fi
  18. echo "Tagging branch head as release ${REL}"
  19. git tag -u 0x6FE57CA8C1A4AEA6 -m "Quagga release $REL" ${REL}
  20. mkdir -p ${TMPDIR}/a || exit 1
  21. mkdir -p ${TMPDIR}/verify || exit 1
  22. echo "Making git archive"
  23. ( git archive ${REL} | tar xC ${TMPDIR}/a ) || exit 1
  24. git log ${PREV}..${REL} > ${TMPDIR}/a/${REL}.changelog.txt || exit 1
  25. git log --pretty=%s ${PREV}..${REL} > ${TMPDIR}/a/${REL}.subjects.txt || exit 1
  26. cd ${TMPDIR}/a || exit 1
  27. echo "Doing test build of archive file and making dist tarball"
  28. (autoreconf -i && ./configure && make -j && make dist-gzip) || exit 1
  29. echo "Verifying dist tarball"
  30. cp ${REL}.tar.gz ${TMPDIR}/verify || exit 1
  31. cd ${TMPDIR}/verify || exit 1
  32. tar -zxf ${REL}.tar.gz || exit 1
  33. cd ${REL} || exit 1
  34. autoreconf -i && ./configure && make -j
  35. cd ${TMPDIR}/a || exit 1
  36. gpg -u 0x6FE57CA8C1A4AEA6 -a --detach-sign ${REL}.tar.gz
  37. cat <<- EOF
  38. Release tagged as: ${REL}
  39. Release files are in ${TMPDIR}/a:
  40. ${TMPDIR}/a/${REL}.tar.gz
  41. ${TMPDIR}/a/${REL}.tar.gz.asc
  42. ${TMPDIR}/a/${REL}.changelog.txt
  43. Changelog summary (subjects) is at:
  44. ${TMPDIR}/a/${REL}.subjects.txt
  45. If you need to redo the release, you must delete the tag first:
  46. git tag -d ${REL}
  47. To finish the release:
  48. * push the tag to savannah:
  49. git push <savannah remote name> tag ${REL}
  50. * Upload the 3 files to the savannah releases area:
  51. scp ${TMPDIR}/a/${REL}.tar.gz \
  52. ${TMPDIR}/a/${REL}.tar.gz.asc \
  53. ${TMPDIR}/a/${REL}.changelog.txt
  54. <username>@dl.sv.nongnu.org:/releases/quagga
  55. * Update the version list in bugzilla:
  56. https://bugzilla.quagga.net/editversions.cgi?action=add&product=Quagga
  57. * Add a news entry to the Savannah front page. The short list of commit
  58. subjects (${TMPDIR}/a/${REL}.subjects.txt) may be useful here.
  59. * Email the quagga-dev and quagga-users lists
  60. EOF