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