Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit 70108c1

Browse files
Merge pull request #2 from gr-oss-devops/publish-to-maven-central
Add publish to maven central
2 parents 8ba0c69 + 0b4dc03 commit 70108c1

File tree

4 files changed

+127
-5
lines changed

4 files changed

+127
-5
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
environment: release
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Maven Central Repository
17+
uses: actions/setup-java@c3ac5dd0ed8db40fedb61c32fbe677e6b355e94c
18+
with:
19+
java-version: '11'
20+
distribution: 'temurin'
21+
server-id: central
22+
server-username: MAVEN_USERNAME
23+
server-password: MAVEN_PASSWORD
24+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
25+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
26+
27+
- name: Build
28+
run: |
29+
cp settings.xml /home/runner/.m2
30+
cat /home/runner/.m2/settings.xml
31+
mvn clean install -DskipTests
32+
env:
33+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
34+
35+
- name: Release artifacts
36+
run: |
37+
pwd
38+
ls -la /home/runner/.m2
39+
cat /home/runner/.m2/settings.xml
40+
mvn --batch-mode deploy -DskipTests
41+
env:
42+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
43+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
44+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,4 @@ build/
3838
### Mac OS ###
3939
.DS_Store
4040

41-
src/main/proto
42-
settings.xml
41+
src/main/proto

pom.xml

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
<modelVersion>4.0.0</modelVersion>
55

66
<groupId>io.armadaproject</groupId>
7-
<artifactId>armada-grpc-java-client</artifactId>
8-
<version>0.0.4</version>
7+
<artifactId>java-client</artifactId>
8+
<version>0.0.1</version>
99
<packaging>jar</packaging>
1010

11-
<name>armada-grpc-java-client</name>
11+
<name>java-client</name>
12+
<url>https://github.com/armadaproject/java-client</url>
1213

1314
<properties>
1415
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -26,11 +27,39 @@
2627
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
2728
</properties>
2829

30+
<licenses>
31+
<license>
32+
<name>Apache 2.0 License</name>
33+
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
34+
<distribution>repo</distribution>
35+
</license>
36+
</licenses>
37+
38+
<developers>
39+
<developer>
40+
<name>Mladjan Gadzic</name>
41+
<email>[email protected]</email>
42+
<organization>G-Research</organization>
43+
<organizationUrl>https://www.gresearch.com/</organizationUrl>
44+
</developer>
45+
</developers>
46+
47+
<scm>
48+
<connection>scm:git:git://github.com/armadaproject/java-client.git</connection>
49+
<developerConnection>scm:git:ssh://github.com:armadaproject/java-client.git</developerConnection>
50+
<url>http://github.com/armadaproject/java-client/tree/main</url>
51+
<tag/>
52+
</scm>
53+
2954
<distributionManagement>
3055
<repository>
3156
<id>github</id>
3257
<url>https://maven.pkg.github.com/mladjan-gadzic/armada-grpc-java-client</url>
3358
</repository>
59+
<repository>
60+
<id>central</id>
61+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
62+
</repository>
3463
</distributionManagement>
3564

3665
<build>
@@ -206,6 +235,32 @@
206235
</execution>
207236
</executions>
208237
</plugin>
238+
239+
<plugin>
240+
<groupId>org.sonatype.central</groupId>
241+
<artifactId>central-publishing-maven-plugin</artifactId>
242+
<version>0.6.0</version>
243+
<extensions>true</extensions>
244+
<configuration>
245+
<publishingServerId>central</publishingServerId>
246+
<autoPublish>true</autoPublish>
247+
</configuration>
248+
</plugin>
249+
250+
<plugin>
251+
<groupId>org.apache.maven.plugins</groupId>
252+
<artifactId>maven-gpg-plugin</artifactId>
253+
<version>3.2.7</version>
254+
<executions>
255+
<execution>
256+
<id>sign-artifacts</id>
257+
<phase>verify</phase>
258+
<goals>
259+
<goal>sign</goal>
260+
</goals>
261+
</execution>
262+
</executions>
263+
</plugin>
209264
</plugins>
210265
</build>
211266

settings.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
4+
<servers>
5+
<server>
6+
<id>central</id>
7+
<username>${env.MAVEN_USERNAME}</username>
8+
<password>${env.MAVEN_PASSWORD}</password>
9+
</server>
10+
</servers>
11+
<profiles>
12+
<profile>
13+
<id>gpg-signing</id>
14+
<properties>
15+
<gpg.executable>gpg</gpg.executable>
16+
<gpg.passphrase>${env.MAVEN_GPG_PASSPHRASE}</gpg.passphrase>
17+
<gpg.args>--batch --pinentry-mode loopback</gpg.args>
18+
</properties>
19+
</profile>
20+
</profiles>
21+
<activeProfiles>
22+
<activeProfile>gpg-signing</activeProfile>
23+
</activeProfiles>
24+
</settings>

0 commit comments

Comments
 (0)