release.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. If you need to redo the release, you must delete the tag first:
  44. git tag -d ${REL}
  45. To finish the release:
  46. * push the tag to savannah:
  47. git push <savannah remote name> tag ${REL}
  48. * Upload the 3 files to the savannah releases area:
  49. scp ${TMPDIR}/a/${REL}.tar.gz \
  50. ${TMPDIR}/a/${REL}.tar.gz.asc \
  51. ${TMPDIR}/a/${REL}.changelog.txt
  52. <username>@dl.sv.nongnu.org:/releases/quagga
  53. * Update the version list in bugzilla:
  54. https://bugzilla.quagga.net/editversions.cgi?action=add&product=Quagga
  55. * Add a news entry to the Savannah front page. The short list of commit
  56. subjects (${TMPDIR}/a/${REL}.subjects.txt) may be useful here.
  57. * Email the quagga-dev and quagga-users lists
  58. EOF