diff options
author | Mark Wielaard <mark@klomp.org> | 2019-06-23 22:18:58 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2019-06-23 22:18:58 +0200 |
commit | 32db5b677a55fc32de6588deae2ac27c28728a05 (patch) | |
tree | 46a8542f85447693ed10403007b6449a8ef687b2 | |
parent | ac9b3847405574dfd6022c1a9347a4449e8c1510 (diff) | |
download | bzip2-32db5b677a55fc32de6588deae2ac27c28728a05.tar.gz bzip2-32db5b677a55fc32de6588deae2ac27c28728a05.tar.bz2 bzip2-32db5b677a55fc32de6588deae2ac27c28728a05.zip |
Add release-update.sh script.
Script to run after a release has been tagged, signed and pushed
to git. Will do a fresh checkout, verify the git tag, do fresh
build/dist, sign the dist with gpg, create a backup copy in HOME,
upload the tar.gz and sig to sourceware, checkout bzip2-htdocs,
copy over the new changes, manual, etc. and git push that to update
https://sourceware.org/bzip2/
-rwxr-xr-x | release-update.sh | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/release-update.sh b/release-update.sh new file mode 100755 index 0000000..2ad32ce --- /dev/null +++ b/release-update.sh | |||
@@ -0,0 +1,85 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # Script to run after a release has been tagged, signed and pushed | ||
4 | # to git. Will do a fresh checkout, verify the git tag, do fresh | ||
5 | # build/dist, sign the dist with gpg, create a backup copy in HOME, | ||
6 | # upload the tar.gz and sig to sourceware, checkout bzip2-htdocs, | ||
7 | # copy over the new changes, manual, etc. and git push that to update | ||
8 | # https://sourceware.org/bzip2/ | ||
9 | |||
10 | # Any error is fatal | ||
11 | set -e | ||
12 | |||
13 | # We take one argument, the version (e.g. 1.0.7) | ||
14 | if [ $# -ne 1 ]; then | ||
15 | echo "$0 <version> (e.g. 1.0.7)" | ||
16 | exit 1 | ||
17 | fi | ||
18 | |||
19 | VERSION="$1" | ||
20 | echo | ||
21 | echo " === NOTE === " | ||
22 | echo | ||
23 | echo "Requires a sourceware account in the bzip2 group." | ||
24 | echo | ||
25 | echo "Make sure the git repo was tagged, signed and pushed" | ||
26 | echo "If not, please double check the source tree is release ready first" | ||
27 | echo "Then do:" | ||
28 | echo | ||
29 | echo " git tag -s -m \"bzip2 $VERSION release\" bzip2-$VERSION" | ||
30 | echo " git push --tags" | ||
31 | echo | ||
32 | read -p "Do you want to continue creating/uploading the release (yes/no)? " | ||
33 | |||
34 | if [ "x$REPLY" != "xyes" ]; then | ||
35 | echo "OK, till next time." | ||
36 | exit | ||
37 | fi | ||
38 | |||
39 | echo "OK, creating and updating the release." | ||
40 | |||
41 | # Create a temporary directoy and make sure it is cleaned up. | ||
42 | tempdir=$(mktemp -d) || exit | ||
43 | trap "rm -rf -- ${tempdir}" EXIT | ||
44 | |||
45 | pushd "${tempdir}" | ||
46 | |||
47 | # Checkout | ||
48 | git clone git://sourceware.org/git/bzip2.git | ||
49 | cd bzip2 | ||
50 | git tag --verify "bzip2-${VERSION}" | ||
51 | git checkout -b "$VERSION" "bzip2-${VERSION}" | ||
52 | |||
53 | # Create dist (creates bzip2-${VERSION}.tar.gz) | ||
54 | make dist | ||
55 | |||
56 | # Sign (creates bzip2-${VERSION}.tar.gz.sig) | ||
57 | gpg -b bzip2-${VERSION}.tar.gz | ||
58 | |||
59 | # Create backup copy | ||
60 | echo "Putting a backup copy in $HOME/bzip2-$VERSION" | ||
61 | mkdir $HOME/bzip2-$VERSION | ||
62 | cp bzip2-${VERSION}.tar.gz bzip2-${VERSION}.tar.gz.sig $HOME/bzip2-$VERSION/ | ||
63 | |||
64 | # Upload | ||
65 | scp bzip2-${VERSION}.tar.gz bzip2-${VERSION}.tar.gz.sig \ | ||
66 | sourceware.org:/sourceware/ftp/pub/bzip2/ | ||
67 | ssh sourceware.org "(cd /sourceware/ftp/pub/bzip2 \ | ||
68 | && ln -sf bzip2-$VERSION.tar.gz bzip2-latest.tar.gz \ | ||
69 | && ln -sf bzip2-$VERSION.tar.gz.sig bzip2-latest.tar.gz.sig \ | ||
70 | && ls -lah bzip2-latest*)" | ||
71 | |||
72 | # Update homepage, manual, etc. | ||
73 | cd "${tempdir}" | ||
74 | git clone ssh://sourceware.org/git/bzip2-htdocs.git | ||
75 | cp bzip2/CHANGES bzip2/bzip.css bzip2-htdocs/ | ||
76 | cp bzip2/bzip.css bzip2/bzip2.txt bzip2/manual.{html,pdf} bzip2-htdocs/manual/ | ||
77 | cd bzip2-htdocs | ||
78 | git commit -a -m "Update for bzip2 $VERSION release" | ||
79 | git show | ||
80 | git push | ||
81 | |||
82 | # Cleanup | ||
83 | popd | ||
84 | trap - EXIT | ||
85 | exit | ||