Skip to content

Commit 5391495

Browse files
committed
Update release script
1 parent 90b4f2a commit 5391495

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

dev-bin/release.sh

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ if [ "$should_continue" != "y" ]; then
6060
exit 1
6161
fi
6262

63+
mvn test
64+
65+
read -r -n 1 -p "Continue given above tests? (y/n) " should_continue
66+
67+
if [ "$should_continue" != "y" ]; then
68+
echo "Aborting"
69+
exit 1
70+
fi
71+
6372
page=.gh-pages/index.md
6473
cat <<EOF > $page
6574
---
@@ -71,30 +80,29 @@ version: $tag
7180
7281
EOF
7382

83+
mvn versions:set -DnewVersion="$version"
84+
7485
perl -pi -e "s/(?<=<version>)[^<]*/$version/" README.md
7586
perl -pi -e "s/(?<=com\.maxmind\.geoip2\:geoip2\:)\d+\.\d+\.\d+([\w\-]+)?/$version/" README.md
7687

7788
cat README.md >> $page
7889

79-
if [ -n "$(git status --porcelain)" ]; then
80-
git diff
81-
82-
read -r -n 1 -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
8996
fi
97+
git add README.md pom.xml
98+
git commit -m "Preparing for $version"
99+
100+
mvn clean deploy
90101

91-
# could be combined with the primary build
92-
mvn release:clean
93-
mvn release:prepare -DreleaseVersion="$version" -Dtag="$tag"
94-
mvn release:perform
95102
rm -fr ".gh-pages/doc/$tag"
96-
cp -r target/checkout/target/reports/apidocs ".gh-pages/doc/$tag"
97-
ln -Tfs "$tag" .gh-pages/doc/latest
103+
cp -r target/reports/apidocs ".gh-pages/doc/$tag"
104+
rm .gh-pages/doc/latest
105+
ln -fs "$tag" .gh-pages/doc/latest
98106

99107
pushd .gh-pages
100108

@@ -106,7 +114,6 @@ echo "Release notes for $version:
106114
$notes
107115
108116
"
109-
110117
read -r -n 1 -p "Push to origin? " should_push
111118

112119
if [ "$should_push" != "y" ]; then
@@ -119,8 +126,7 @@ git push
119126
popd
120127

121128
git push
122-
git push --tags
123129

124130
gh release create --target "$(git branch --show-current)" -t "$version" -n "$notes" "$tag" \
125-
"target/checkout/target/geoip2-$version-with-dependencies.zip" \
126-
"target/checkout/target/geoip2-$version-with-dependencies.zip.asc"
131+
"target/geoip2-$version-with-dependencies.zip" \
132+
"target/geoip2-$version-with-dependencies.zip.asc"

0 commit comments

Comments
 (0)