@@ -5,7 +5,7 @@ set -eu -o pipefail
5
5
changelog=$( cat CHANGELOG.md)
6
6
7
7
regex='
8
- ([0-9]+\.[0-9]+\.[0-9]+(-[^ ]+)? ) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\)
8
+ ([0-9]+\.[0-9]+\.[0-9]+[a-zA-Z0-9\-]* ) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\)
9
9
-*
10
10
11
11
((.|
@@ -18,8 +18,8 @@ if [[ ! $changelog =~ $regex ]]; then
18
18
fi
19
19
20
20
version=" ${BASH_REMATCH[1]} "
21
- date=" ${BASH_REMATCH[3 ]} "
22
- notes=" $( echo " ${BASH_REMATCH[4 ]} " | sed -n -E ' /^[0-9]+\.[0-9]+\.[0-9]+/,$!p' ) "
21
+ date=" ${BASH_REMATCH[2 ]} "
22
+ notes=" $( echo " ${BASH_REMATCH[3 ]} " | sed -n -e ' /^[0-9]\ +\.[0-9]\ +\.[0-9]\ +/,$!p' ) "
23
23
24
24
if [[ " $date " != $( date +" %Y-%m-%d" ) ]]; then
25
25
echo " $date is not today!"
53
53
mvn versions:display-plugin-updates
54
54
mvn versions:display-dependency-updates
55
55
56
- read -e -p " Continue given above dependencies? (y/n) " should_continue
56
+ read -r -n 1 -p " Continue given above dependencies? (y/n) " should_continue
57
+
58
+ if [ " $should_continue " != " y" ]; then
59
+ echo " Aborting"
60
+ exit 1
61
+ fi
62
+
63
+ mvn test
64
+
65
+ read -r -n 1 -p " Continue given above tests? (y/n) " should_continue
57
66
58
67
if [ " $should_continue " != " y" ]; then
59
68
echo " Aborting"
@@ -64,36 +73,36 @@ page=.gh-pages/index.md
64
73
cat << EOF > $page
65
74
---
66
75
layout: default
67
- title: MaxMind minFraud Score and Insights Java API
76
+ title: MaxMind minFraud Java API
68
77
language: java
69
78
version: $tag
70
79
---
71
80
72
81
EOF
73
82
83
+ mvn versions:set -DnewVersion=" $version "
84
+
74
85
perl -pi -e " s/(?<=<version>)[^<]*/$version /" README.md
75
- perl -pi -e " s/(?<=com\.maxmind\.minfraud\:minfraud\:)\d+\.\d+\.\d+[^']* /$version /" README.md
86
+ perl -pi -e " s/(?<=com\.maxmind\.minfraud\:minfraud\:)\d+\.\d+\.\d+([\w\-]+)? /$version /" README.md
76
87
77
88
cat README.md >> $page
78
89
79
- if [ -n " $( git status --porcelain) " ]; then
80
- git diff
81
-
82
- read -e -p " Commit README.md changes? " should_commit
83
- if [ " $should_commit " != " y" ]; then
84
- echo " Aborting"
85
- exit 1
86
- fi
87
- git add README.md
88
- git commit -m ' update version number in README.md'
90
+ git diff
91
+
92
+ read -r -n 1 -p " Commit changes? " should_commit
93
+ if [ " $should_commit " != " y" ]; then
94
+ echo " Aborting"
95
+ exit 1
89
96
fi
97
+ git add README.md pom.xml
98
+ git commit -m " Preparing for $version "
99
+
100
+ mvn clean deploy
90
101
91
- # could be combined with the primary build
92
- mvn release:clean
93
- mvn release:prepare -DreleaseVersion=" $version " -Dtag=" $tag "
94
- mvn release:perform
95
102
rm -fr " .gh-pages/doc/$tag "
96
- cp -r target/checkout/target/reports/apidocs " .gh-pages/doc/$tag "
103
+ cp -r target/reports/apidocs " .gh-pages/doc/$tag "
104
+ rm -f .gh-pages/doc/latest
105
+ ln -fs " $tag " .gh-pages/doc/latest
97
106
98
107
pushd .gh-pages
99
108
@@ -105,8 +114,7 @@ echo "Release notes for $version:
105
114
$notes
106
115
107
116
"
108
-
109
- read -e -p " Push to origin? " should_push
117
+ read -r -n 1 -p " Push to origin? " should_push
110
118
111
119
if [ " $should_push " != " y" ]; then
112
120
echo " Aborting"
@@ -118,8 +126,7 @@ git push
118
126
popd
119
127
120
128
git push
121
- git push --tags
122
129
123
130
gh release create --target " $( git branch --show-current) " -t " $version " -n " $notes " " $tag " \
124
- " target/checkout/target/ minfraud-$version -with-dependencies.zip" \
125
- " target/checkout/target/ minfraud-$version -with-dependencies.zip.asc"
131
+ " target/minfraud-$version -with-dependencies.zip" \
132
+ " target/minfraud-$version -with-dependencies.zip.asc"
0 commit comments