Skip to content

Commit daf9e19

Browse files
committed
Push to Maven central
1 parent 8ef83a0 commit daf9e19

File tree

2 files changed

+76
-11
lines changed

2 files changed

+76
-11
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
name: Deploy snapshots
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
# TODO REMOVE
9+
pull_request:
10+
jobs:
11+
release:
12+
name: Release on Sonatype OSS
13+
runs-on: ubuntu-latest
14+
if: github.repository_owner == 'hazelcast'
15+
16+
steps:
17+
- uses: actions/checkout@v5
18+
- uses: actions/setup-java@v5
19+
with:
20+
java-version: 17
21+
distribution: 'temurin'
22+
server-id: snapshot-repository
23+
server-username: ${{ secrets.SONATYPE_OSS_USERNAME }}
24+
server-password: ${{ secrets.SONATYPE_OSS_PASSWORD }}
25+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
26+
gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
27+
cache: 'maven'
28+
- run: |
29+
PROJECT_VERSION=$(mvn --quiet help:evaluate -Dexpression='project.version' -DforceStdout)
30+
if [[ "$PROJECT_VERSION" == *-SNAPSHOT ]]; then
31+
mvn -Prelease deploy
32+
fi
33+
env:
34+
MAVEN_ARGS: --batch-mode

pom.xml

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<repository>
1515
<id>snapshot-repository</id>
1616
<name>Maven2 Snapshot Repository</name>
17-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
17+
<url>https://central.sonatype.com/repository/maven-snapshots</url>
1818
</repository>
1919
<repository>
2020
<id>private-repository</id>
@@ -65,14 +65,6 @@
6565
</license>
6666
</licenses>
6767

68-
<developers>
69-
<developer>
70-
<id>asimarslan</id>
71-
<name>asim arslan</name>
72-
<email>[email protected]</email>
73-
</developer>
74-
</developers>
75-
7668
<organization>
7769
<name>Hazelcast, Inc.</name>
7870
<url>http://www.hazelcast.com/</url>
@@ -226,15 +218,54 @@
226218
<distributionManagement>
227219
<repository>
228220
<id>release-repository</id>
229-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
221+
<url>https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/</url>
230222
</repository>
231223
<snapshotRepository>
232224
<id>snapshot-repository</id>
233225
<name>Maven2 Snapshot Repository</name>
234-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
226+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
235227
<uniqueVersion>false</uniqueVersion>
236228
</snapshotRepository>
237229
</distributionManagement>
238230

231+
<profiles>
232+
<profile>
233+
<id>release</id>
234+
<build>
235+
<plugins>
236+
<plugin>
237+
<groupId>org.sonatype.plugins</groupId>
238+
<artifactId>nexus-staging-maven-plugin</artifactId>
239+
<version>1.7.0</version>
240+
<extensions>true</extensions>
241+
<configuration>
242+
<serverId>ossrh</serverId>
243+
<nexusUrl>https://ossrh-staging-api.central.sonatype.com/</nexusUrl>
244+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
245+
</configuration>
246+
</plugin>
247+
<plugin>
248+
<groupId>org.apache.maven.plugins</groupId>
249+
<artifactId>maven-gpg-plugin</artifactId>
250+
<version>3.2.8</version>
251+
<executions>
252+
<execution>
253+
<phase>verify</phase>
254+
<goals>
255+
<goal>sign</goal>
256+
</goals>
257+
</execution>
258+
</executions>
259+
<configuration>
260+
<gpgArguments>
261+
<gpgArgument>--pinentry-mode</gpgArgument>
262+
<gpgArgument>loopback</gpgArgument>
263+
</gpgArguments>
264+
</configuration>
265+
</plugin>
266+
</plugins>
267+
</build>
268+
</profile>
269+
</profiles>
239270
</project>
240271

0 commit comments

Comments
 (0)