Skip to content

Commit af2827f

Browse files
committed
Change groupId to io.github.manoelcampos
- Update version to 1.1.3 - Update dependencies - Add deploy GitHub Action workflow - Update build GitHub Action workflow Signed-off-by: Manoel Campos <[email protected]>
1 parent 9f3b1f9 commit af2827f

File tree

4 files changed

+67
-42
lines changed

4 files changed

+67
-42
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
runs-on: ubuntu-20.04
1111
name: Java 17 Build
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- name: Setup Java
15-
uses: actions/setup-java@v3
15+
uses: actions/setup-java@v4
1616
with:
1717
distribution: 'adopt'
1818
java-version: 17
1919
cache: 'maven'
2020
- name: Maven Build
21-
run: mvn -B package
21+
run: mvn -B package

.github/workflows/deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish to Maven Central
2+
on:
3+
push:
4+
tags:
5+
- 'v*.*.*'
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Set up Maven Central Repository
12+
uses: actions/setup-java@v4
13+
with:
14+
java-version: '17'
15+
distribution: 'adopt'
16+
server-id: central
17+
# ~/.m2/settings.xml
18+
server-username: MAVEN_USERNAME
19+
server-password: MAVEN_PASSWORD
20+
cache: 'maven'
21+
- id: install-secret-key
22+
name: Install gpg secret key
23+
run: |
24+
# The key to assing to OSSRH_GPG_SECRET_KEY can be got running on your PC: gpg -a --export-secret-keys KEY_ID
25+
# The KEY_ID can be got from the GPG Keyhain.
26+
# The OSSRH_GPG_SECRET_KEY_PASSWORD is in macOS keychain (GPG Key password)
27+
# OSSRH_USERNAME and OSSRH_TOKEN (password) are available at ~/.m2/settings.xml
28+
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
29+
gpg --list-keys
30+
- name: Publish package
31+
run: mvn --no-transfer-progress -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} --batch-mode -Psonatype deploy
32+
env:
33+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
34+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Include the library inside your project's pom.xml:
88

99
```xml
1010
<dependency>
11-
<groupId>com.manoelcampos</groupId>
11+
<groupId>io.github.manoelcampos</groupId>
1212
<artifactId>random-org-client</artifactId>
13-
<version>1.1.0</version>
13+
<version>LATEST</version>
1414
</dependency>
1515
```
1616

@@ -21,4 +21,4 @@ Check an example inside the [main method here](https://github.com/manoelcampos/r
2121
The example is loading the service API key from a .env file.
2222
In order to make it work in your project, create a .env file inside the project root dir and insert your API key, as demonstrated in [ .env.example]( .env.example).
2323

24-
If you don't want to use an .env file, just pass the API key to the `RandomOrgClient` constructor.
24+
If you don't want to use an .env file, just pass the API key to the `RandomOrgClient` constructor.

pom.xml

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>com.manoelcampos</groupId>
7+
<groupId>io.github.manoelcampos</groupId>
88
<artifactId>random-org-client</artifactId>
9-
<version>1.1.0</version>
9+
<version>1.1.3</version>
1010
<name>random.org client</name>
1111
<url>https://github.com/manoelcampos/random-org-java-client</url>
1212
<description>
@@ -59,12 +59,13 @@
5959
<plugin>
6060
<groupId>org.apache.maven.plugins</groupId>
6161
<artifactId>maven-surefire-plugin</artifactId>
62+
<version>3.5.3</version>
6263
</plugin>
6364

6465
<plugin>
6566
<groupId>org.apache.maven.plugins</groupId>
6667
<artifactId>maven-source-plugin</artifactId>
67-
<version>3.2.1</version>
68+
<version>3.3.1</version>
6869
<executions>
6970
<execution>
7071
<id>attach-sources</id>
@@ -106,28 +107,17 @@
106107
-->
107108
<id>sonatype</id>
108109

109-
<!--
110-
URLs to deploy the project at the Maven Central (http://mvnrepository.com)
111-
using a Sonatype account (http://central.sonatype.org)
112-
See the "all" profile in this pom for deployment information.
113-
-->
114-
<distributionManagement>
115-
<snapshotRepository>
116-
<id>ossrh</id>
117-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
118-
</snapshotRepository>
119-
<repository>
120-
<id>ossrh</id>
121-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
122-
</repository>
123-
</distributionManagement>
124-
125110
<build>
126111
<plugins>
112+
<plugin>
113+
<groupId>org.apache.maven.plugins</groupId>
114+
<artifactId>maven-surefire-plugin</artifactId>
115+
</plugin>
116+
127117
<plugin>
128118
<groupId>org.apache.maven.plugins</groupId>
129119
<artifactId>maven-source-plugin</artifactId>
130-
<version>3.2.1</version>
120+
<version>3.3.1</version>
131121
<executions>
132122
<execution>
133123
<id>attach-sources</id>
@@ -159,7 +149,7 @@
159149
<plugin>
160150
<groupId>org.apache.maven.plugins</groupId>
161151
<artifactId>maven-gpg-plugin</artifactId>
162-
<version>1.6</version>
152+
<version>3.2.8</version>
163153
<executions>
164154
<execution>
165155
<id>sign-artifacts</id>
@@ -180,19 +170,21 @@
180170
</plugin>
181171

182172
<!--
183-
Plugin to deploy to the maven central using a Sonatype account.
173+
Plugin to deploy to the maven central using the new
174+
Central Portal at https://central.sonatype.com.
184175
Credentials are defined into the local repo settings.xml
176+
https://central.sonatype.org/publish/publish-portal-maven
185177
-->
186178
<plugin>
187-
<groupId>org.sonatype.plugins</groupId>
188-
<artifactId>nexus-staging-maven-plugin</artifactId>
189-
<version>1.6.13</version>
179+
<groupId>org.sonatype.central</groupId>
180+
<artifactId>central-publishing-maven-plugin</artifactId>
181+
<version>0.8.0</version>
190182
<extensions>true</extensions>
191183
<configuration>
192-
<serverId>manoelcampos-ossrh</serverId>
193-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
194-
<!--If the artifact will be automatically released to maven central after the upload to sonatype.-->
195-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
184+
<!-- The id of the server tag inside the local maven settings.xml file-->
185+
<publishingServerId>central</publishingServerId>
186+
<autoPublish>true</autoPublish>
187+
<waitUntil>published</waitUntil>
196188
</configuration>
197189
</plugin>
198190
</plugins>
@@ -207,7 +199,7 @@
207199
<plugin>
208200
<groupId>org.apache.maven.plugins</groupId>
209201
<artifactId>maven-javadoc-plugin</artifactId>
210-
<version>3.5.0</version>
202+
<version>3.11.2</version>
211203
<configuration>
212204
<failOnError>false</failOnError>
213205
</configuration>
@@ -220,24 +212,23 @@
220212
<dependency>
221213
<groupId>io.github.cdimascio</groupId>
222214
<artifactId>dotenv-java</artifactId>
223-
<version>3.0.0</version>
215+
<version>3.2.0</version>
224216
</dependency>
225217
<dependency>
226218
<groupId>com.fasterxml.jackson.core</groupId>
227219
<artifactId>jackson-databind</artifactId>
228-
<version>2.15.0</version>
220+
<version>2.19.1</version>
229221
</dependency>
230222
<dependency>
231223
<groupId>com.fasterxml.jackson.datatype</groupId>
232224
<artifactId>jackson-datatype-jsr310</artifactId>
233-
<version>2.15.0</version>
225+
<version>2.19.1</version>
234226
</dependency>
235227
<dependency>
236228
<groupId>org.projectlombok</groupId>
237229
<artifactId>lombok</artifactId>
238-
<version>1.18.28</version>
230+
<version>1.18.38</version>
239231
<scope>provided</scope>
240232
</dependency>
241233
</dependencies>
242-
243-
</project>
234+
</project>

0 commit comments

Comments
 (0)