File tree Expand file tree Collapse file tree 2 files changed +93
-0
lines changed Expand file tree Collapse file tree 2 files changed +93
-0
lines changed Original file line number Diff line number Diff line change
1
+ CHANGELOG
2
+ =========
3
+
4
+ 0.1.0 (2015-06-XX)
5
+ ------------------
6
+
7
+ * Initial release
Original file line number Diff line number Diff line change
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
+ if [ -n " $( git status --porcelain) " ]; then
17
+ echo " . is not clean." >&2
18
+ exit 1
19
+ fi
20
+
21
+ if [ ! -d .gh-pages ]; then
22
+ echo " Checking out gh-pages in .gh-pages"
23
+ git clone -b gh-pages
[email protected] :GeoIP2-java .gh-pages
24
+ pushd .gh-pages
25
+ else
26
+ echo " Updating .gh-pages"
27
+ pushd .gh-pages
28
+ git pull
29
+ fi
30
+
31
+ if [ -n " $( git status --porcelain) " ]; then
32
+ echo " .gh-pages is not clean" >&2
33
+ exit 1
34
+ fi
35
+
36
+ popd
37
+
38
+ mvn versions:display-dependency-updates
39
+
40
+ read -e -p " Continue given above dependencies? (y/n) " SHOULD_CONTINUE
41
+
42
+ if [ " $SHOULD_CONTINUE " != " y" ]; then
43
+ echo " Aborting"
44
+ exit 1
45
+ fi
46
+
47
+ PAGE=.gh-pages/index.md
48
+ cat << EOF > $PAGE
49
+ ---
50
+ layout: default
51
+ title: MaxMind minFraud Score and Insights Java API
52
+ language: java
53
+ version: $TAG
54
+ ---
55
+
56
+ EOF
57
+
58
+ cat README.md >> $PAGE
59
+
60
+ # could be combined with the primary build
61
+ mvn release:clean
62
+ mvn release:prepare -DreleaseVersion=$VERSION -Dtag=$TAG
63
+ mvn release:perform
64
+ rm -fr " .gh-pages/doc/$TAG "
65
+ cp -r target/apidocs .gh-pages/doc/$TAG
66
+
67
+ pushd .gh-pages
68
+
69
+ git add doc/
70
+ git commit -m " Updated for $TAG " -a
71
+
72
+ read -e -p " Push to origin? " SHOULD_PUSH
73
+
74
+ if [ " $SHOULD_PUSH " != " y" ]; then
75
+ echo " Aborting"
76
+ exit 1
77
+ fi
78
+
79
+ git push
80
+
81
+ popd
82
+
83
+ git push
84
+ git push --tags
85
+
86
+ echo " Remember to do the release on https://oss.sonatype.org/!"
You can’t perform that action at this time.
0 commit comments