Skip to content

Commit 2256fa1

Browse files
authored
Push artifacts to Hazelcast repository [DI-639] (#75)
We _were_ pushing `SNAPSHOT`s to Maven central, but these are [no longer retained long-term](https://central.sonatype.org/publish/publish-portal-snapshots). Instead we should push to _our_ repositories. [Example execution](https://github.com/hazelcast/hazelcast-remote-controller/actions/runs/17826114838), pushing [to the `SNAPSHOT` repo](https://repository.hazelcast.com/snapshot/com/hazelcast/hazelcast-remote-controller/). Fixes: [DI-639](https://hazelcast.atlassian.net/browse/DI-639) [DI-639]: https://hazelcast.atlassian.net/browse/DI-639?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 8ef83a0 commit 2256fa1

File tree

2 files changed

+79
-20
lines changed

2 files changed

+79
-20
lines changed

.github/workflows/deploy.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
if: github.repository_owner == 'hazelcast'
12+
steps:
13+
- uses: actions/checkout@v5
14+
15+
- uses: actions/setup-java@v5
16+
with:
17+
java-version: 17
18+
distribution: 'temurin'
19+
server-id: deploy-repository
20+
server-username: MAVEN_USERNAME
21+
server-password: MAVEN_PASSWORD
22+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
23+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
24+
cache: 'maven'
25+
26+
- run: |
27+
mvn \
28+
deploy \
29+
--activate-profiles release \
30+
--batch-mode \
31+
--no-transfer-progress
32+
env:
33+
MAVEN_USERNAME: ${{ secrets.JFROG_USERNAME }}
34+
MAVEN_PASSWORD: ${{ secrets.JFROG_PASSWORD }}
35+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

pom.xml

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@
1212

1313
<repositories>
1414
<repository>
15-
<id>snapshot-repository</id>
16-
<name>Maven2 Snapshot Repository</name>
17-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
18-
</repository>
19-
<repository>
20-
<id>private-repository</id>
15+
<id>hazelcast-private-repository</id>
2116
<name>Hazelcast Private Repository</name>
2217
<url>https://repository.hazelcast.com/release/</url>
2318
<releases>
@@ -27,6 +22,17 @@
2722
<enabled>false</enabled>
2823
</snapshots>
2924
</repository>
25+
<repository>
26+
<id>hazelcast-private-snapshot-repository</id>
27+
<name>Hazelcast Private Repository</name>
28+
<url>https://repository.hazelcast.com/snapshot/</url>
29+
<releases>
30+
<enabled>false</enabled>
31+
</releases>
32+
<snapshots>
33+
<enabled>true</enabled>
34+
</snapshots>
35+
</repository>
3036
</repositories>
3137
<properties>
3238
<main.basedir>${project.basedir}</main.basedir>
@@ -65,14 +71,6 @@
6571
</license>
6672
</licenses>
6773

68-
<developers>
69-
<developer>
70-
<id>asimarslan</id>
71-
<name>asim arslan</name>
72-
<email>[email protected]</email>
73-
</developer>
74-
</developers>
75-
7674
<organization>
7775
<name>Hazelcast, Inc.</name>
7876
<url>http://www.hazelcast.com/</url>
@@ -225,16 +223,42 @@
225223
</dependencies>
226224
<distributionManagement>
227225
<repository>
228-
<id>release-repository</id>
229-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
226+
<id>deploy-repository</id>
227+
<url>https://repository.hazelcast.com/release</url>
230228
</repository>
231229
<snapshotRepository>
232-
<id>snapshot-repository</id>
233-
<name>Maven2 Snapshot Repository</name>
234-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
235-
<uniqueVersion>false</uniqueVersion>
230+
<id>deploy-repository</id>
231+
<url>https://repository.hazelcast.com/snapshot</url>
236232
</snapshotRepository>
237233
</distributionManagement>
238234

235+
<profiles>
236+
<profile>
237+
<id>release</id>
238+
<build>
239+
<plugins>
240+
<plugin>
241+
<groupId>org.apache.maven.plugins</groupId>
242+
<artifactId>maven-gpg-plugin</artifactId>
243+
<version>3.2.8</version>
244+
<executions>
245+
<execution>
246+
<phase>verify</phase>
247+
<goals>
248+
<goal>sign</goal>
249+
</goals>
250+
</execution>
251+
</executions>
252+
<configuration>
253+
<gpgArguments>
254+
<gpgArgument>--pinentry-mode</gpgArgument>
255+
<gpgArgument>loopback</gpgArgument>
256+
</gpgArguments>
257+
</configuration>
258+
</plugin>
259+
</plugins>
260+
</build>
261+
</profile>
262+
</profiles>
239263
</project>
240264

0 commit comments

Comments
 (0)