-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrelease.sh
executable file
·73 lines (55 loc) · 1.75 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# This script assists with making a new pdfgrep release.
#
# Usage: ./release.sh VERSION WEBSITE_DIR
#
# where VERSION is the version number (e.g 2.0.1)
# and WEBSITE_DIR is the path to the git repo for pdfgrep.org
set -e
version="$1"
website="$2"
if [ -z "$1" ] || [ "$1" = -h ] || [ -z "$2" ]; then
echo "$0 VERSION WEBSITE_DIR"
exit 0
fi
if git status --porcelain | grep '^ M' ; then
echo "You have unstaged changes!" >&2
exit 1
fi
echo "### Updating version in NEWS.md"
headline="Version $version [$(date +%Y-%m-%d)]"
underline=$(echo "$headline" | sed 's/./-/g')
sed -i "s/^NEXT RELEASE/$headline/" NEWS.md
sed -i "2 s/.*/$underline/" NEWS.md
echo "### Updating version in configure.ac"
sed -i "1s/\[[0-9.]\+\]/[${version}]/" configure.ac
git diff
echo -en "\nPress enter to continue with make distcheck..."
read
echo "### Running make distcheck"
make distcheck
echo -en "\nPress enter to continue with committing..."
read
echo "### Committing the changes"
git commit -m "Version $version" NEWS.md configure.ac
echo -en "\nPress enter to continue with tagging..."
read
echo "### Tagging"
git tag -s "v$version" -m "Version $version"
echo -en "\nPress enter to continue signing..."
read
echo "### Signing tarball"
tarball=pdfgrep-$version.tar.gz
gpg --armor --detach-sign $tarball
echo -en "\nPress enter to continue with copying to website..."
read
echo "### Copying files to website repo"
cp $tarball $website/site/download/
cp ${tarball}.asc $website/site/download/
cp doc/pdfgrep.asciidoc $website/site/manpages/manpage-${version}.txt
echo "### Done. Steps to do:"
echo " - git push"
echo " - git push --tags"
echo " - Commit and push changes to website"
echo " - Write announcement for website"
echo " - Write announcement mailing list"