Skip to content

Commit 377b482

Browse files
authored
Merge pull request #555 from maxmind/greg/eng-1937
Release to Central Portal
2 parents ba41c7a + 3fc3ac5 commit 377b482

File tree

6 files changed

+42
-76
lines changed

6 files changed

+42
-76
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
.settings
1414
doc
1515
hs_err*.log
16+
pom.xml.versionsBackup
1617
target
1718
reports
1819
Test.java

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
4.3.1 (2025-05-28)
5+
------------------
6+
7+
* First release using Central Portal instead of Legacy OSSRH.
8+
* Dependency updates.
9+
410
4.3.0 (2025-05-05)
511
------------------
612

README.dev.md

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1 @@
1-
There is a release script at `dev-bin/release.sh` that will do the full
2-
release, including updating the GitHub Pages site.
3-
4-
This script reads the VERSION number from `CHANGELOG.md`, which you should
5-
have updated to contain the new version number and today's date. After
6-
uploading with this script, you will need to perform the release on the
7-
[Sonatype OSS site](https://oss.sonatype.org/index.html).
8-
9-
We release to the Maven Central Repository through Sonatype OSSRH. They
10-
provide [detailed directions](https://central.sonatype.org/pages/apache-maven.html)
11-
on the steps of the release or snapshot release process.
12-
13-
All releases should follow [Semantic Versioning](https://semver.org/).
14-
15-
Steps for releasing:
16-
17-
1. Review open issues and PRs to see if any can easily be fixed, closed, or
18-
merged.
19-
2. Bump copyright year in `README.md`, if necessary.
20-
* You do not need to update the version. The release script will do so.
21-
3. Review `CHANGELOG.md` for completeness and correctness. Update its release
22-
date. Commit it.
23-
4. Install or update [gh](https://github.com/cli/cli) as it used by the release script.
24-
5. Test that `mvn package` can complete successfully. Run `git clean -dxff`
25-
or something similar to clean up afterwards.
26-
6. Run `./dev-bin/release.sh`.
27-
* This will package the release, update the gh-pages branch, bump the
28-
version to the next development release, upload the release to GitHub
29-
and tag it, and upload to Sonatype.
30-
* It may prompt you about out of date dependencies. You should consider
31-
updating them if appropriate. Say no and review the changes and upate
32-
`pom.xml` and start the release process over again if you do.
33-
7. The `nexus-staging-maven-plugin` will automatically promote the release on Sonatype.
34-
35-
There is more information in the
36-
[minfraud-api-java](https://github.com/maxmind/minfraud-api-java/blob/main/README.dev.md)
37-
`README.dev.md` about doing a Java release, including setting up your
38-
environment and completing the release on Sonatype.
1+
See the [`README.dev.md` in `minfraud-api-java`](https://github.com/maxmind/minfraud-api-java/blob/main/README.dev.md).

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To do this, add the dependency to your pom.xml:
1717
<dependency>
1818
<groupId>com.maxmind.geoip2</groupId>
1919
<artifactId>geoip2</artifactId>
20-
<version>4.3.0</version>
20+
<version>4.3.1</version>
2121
</dependency>
2222
```
2323

@@ -30,7 +30,7 @@ repositories {
3030
mavenCentral()
3131
}
3232
dependencies {
33-
compile 'com.maxmind.geoip2:geoip2:4.3.0'
33+
compile 'com.maxmind.geoip2:geoip2:4.3.1'
3434
}
3535
```
3636

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"

pom.xml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.maxmind.geoip2</groupId>
55
<artifactId>geoip2</artifactId>
6-
<version>4.3.1-SNAPSHOT</version>
6+
<version>4.3.1</version>
77
<packaging>jar</packaging>
88
<name>MaxMind GeoIP2 API</name>
99
<description>GeoIP2 webservice client and database reader</description>
@@ -242,24 +242,14 @@
242242
<version>2.18.0</version>
243243
</plugin>
244244
<plugin>
245-
<groupId>org.sonatype.plugins</groupId>
246-
<artifactId>nexus-staging-maven-plugin</artifactId>
247-
<version>1.7.0</version>
245+
<groupId>org.sonatype.central</groupId>
246+
<artifactId>central-publishing-maven-plugin</artifactId>
247+
<version>0.7.0</version>
248248
<extensions>true</extensions>
249249
<configuration>
250-
<serverId>sonatype-nexus-staging</serverId>
251-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
252-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
250+
<publishingServerId>central</publishingServerId>
251+
<autoPublish>true</autoPublish>
253252
</configuration>
254-
<executions>
255-
<execution>
256-
<id>default-deploy</id>
257-
<phase>deploy</phase>
258-
<goals>
259-
<goal>deploy</goal>
260-
</goals>
261-
</execution>
262-
</executions>
263253
</plugin>
264254
</plugins>
265255
</build>

0 commit comments

Comments
 (0)