Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit f3a2336

Browse files
committed
Add release script
1 parent e078ec1 commit f3a2336

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

dev-bin/release.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
VERSION=$(perl -MFile::Slurp::Tiny=read_file -MDateTime <<EOF
6+
use v5.16;
7+
my \$log = read_file(q{ChangeLog.md});
8+
\$log =~ /\n(\d+\.\d+\.\d+) \((\d{4}-\d{2}-\d{2})\)\n/;
9+
die 'Release time is not today!' unless DateTime->now->ymd eq \$2;
10+
say \$1;
11+
EOF
12+
)
13+
14+
TAG="v$VERSION"
15+
16+
git pull
17+
18+
if [ -n "$(git status --porcelain)" ]; then
19+
echo ". is not clean." >&2
20+
exit 1
21+
fi
22+
23+
export VERSION
24+
perl -pi -e "s/(?<=^AC_INIT\(\[geoipupdate\], \[).+?(?=\])/$VERSION/g" configure.ac
25+
26+
./bootstrap
27+
./configure
28+
make clean
29+
make dist
30+
31+
git diff
32+
33+
read -e -p "Push to origin? " SHOULD_PUSH
34+
35+
if [ "$SHOULD_PUSH" != "y" ]; then
36+
echo "Aborting"
37+
exit 1
38+
fi
39+
40+
git commit -m "Update version number for $TAG" -a
41+
42+
git tag -a "$TAG"
43+
git push
44+
git push --tags
45+
46+
echo "Release to PPA and Homebrew"

0 commit comments

Comments
 (0)