aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2019-06-23 22:18:58 +0200
committerMark Wielaard <mark@klomp.org>2019-06-23 22:18:58 +0200
commit32db5b677a55fc32de6588deae2ac27c28728a05 (patch)
tree46a8542f85447693ed10403007b6449a8ef687b2
parentac9b3847405574dfd6022c1a9347a4449e8c1510 (diff)
downloadbzip2-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-xrelease-update.sh85
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
11set -e
12
13# We take one argument, the version (e.g. 1.0.7)
14if [ $# -ne 1 ]; then
15 echo "$0 <version> (e.g. 1.0.7)"
16 exit 1
17fi
18
19VERSION="$1"
20echo
21echo " === NOTE === "
22echo
23echo "Requires a sourceware account in the bzip2 group."
24echo
25echo "Make sure the git repo was tagged, signed and pushed"
26echo "If not, please double check the source tree is release ready first"
27echo "Then do:"
28echo
29echo " git tag -s -m \"bzip2 $VERSION release\" bzip2-$VERSION"
30echo " git push --tags"
31echo
32read -p "Do you want to continue creating/uploading the release (yes/no)? "
33
34if [ "x$REPLY" != "xyes" ]; then
35 echo "OK, till next time."
36 exit
37fi
38
39echo "OK, creating and updating the release."
40
41# Create a temporary directoy and make sure it is cleaned up.
42tempdir=$(mktemp -d) || exit
43trap "rm -rf -- ${tempdir}" EXIT
44
45pushd "${tempdir}"
46
47# Checkout
48git clone git://sourceware.org/git/bzip2.git
49cd bzip2
50git tag --verify "bzip2-${VERSION}"
51git checkout -b "$VERSION" "bzip2-${VERSION}"
52
53# Create dist (creates bzip2-${VERSION}.tar.gz)
54make dist
55
56# Sign (creates bzip2-${VERSION}.tar.gz.sig)
57gpg -b bzip2-${VERSION}.tar.gz
58
59# Create backup copy
60echo "Putting a backup copy in $HOME/bzip2-$VERSION"
61mkdir $HOME/bzip2-$VERSION
62cp bzip2-${VERSION}.tar.gz bzip2-${VERSION}.tar.gz.sig $HOME/bzip2-$VERSION/
63
64# Upload
65scp bzip2-${VERSION}.tar.gz bzip2-${VERSION}.tar.gz.sig \
66 sourceware.org:/sourceware/ftp/pub/bzip2/
67ssh 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.
73cd "${tempdir}"
74git clone ssh://sourceware.org/git/bzip2-htdocs.git
75cp bzip2/CHANGES bzip2/bzip.css bzip2-htdocs/
76cp bzip2/bzip.css bzip2/bzip2.txt bzip2/manual.{html,pdf} bzip2-htdocs/manual/
77cd bzip2-htdocs
78git commit -a -m "Update for bzip2 $VERSION release"
79git show
80git push
81
82# Cleanup
83popd
84trap - EXIT
85exit