Skip to content

Commit 1dec8ed

Browse files
committed
Configure Maven Central publishing with GPG signing
1 parent 21b438a commit 1dec8ed

3 files changed

Lines changed: 85 additions & 9 deletions

File tree

.github/workflows/publish.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ jobs:
2020
with:
2121
java-version: '17'
2222
distribution: 'temurin'
23-
server-id: github
24-
settings-path: ${{ github.workspace }}
23+
server-id: central
24+
server-username: MAVEN_CENTRAL_USERNAME
25+
server-password: MAVEN_CENTRAL_PASSWORD
2526

26-
- name: Build with Maven
27-
run: mvn -B package --file pom.xml
27+
- name: Import GPG Key
28+
uses: crazy-max/ghaction-import-gpg@v6
29+
with:
30+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
31+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
2832

29-
- name: Publish to GitHub Packages
30-
run: mvn deploy -s settings.xml
33+
- name: Publish to Maven Central
34+
run: mvn --batch-mode clean deploy -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}"
3135
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
37+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For setup details and the full API reference, see [reloop.sh/docs](https://reloo
1515
<dependency>
1616
<groupId>sh.reloop</groupId>
1717
<artifactId>reloop-java</artifactId>
18-
<version>1.8.0</version>
18+
<version>0.1.0</version>
1919
</dependency>
2020
```
2121

pom.xml

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66

77
<groupId>sh.reloop</groupId>
88
<artifactId>reloop-java</artifactId>
9-
<version>1.8.0</version>
9+
<version>0.1.0</version>
10+
11+
<name>reloop-java</name>
12+
<description>Java SDK for Reloop</description>
13+
<url>https://github.com/reloop-labs/reloop-java</url>
1014

1115
<licenses>
1216
<license>
@@ -16,6 +20,22 @@
1620
</license>
1721
</licenses>
1822

23+
<developers>
24+
<developer>
25+
<id>reloop</id>
26+
<name>Reloop Team</name>
27+
<email>dev@reloop.sh</email>
28+
<organization>Reloop</organization>
29+
<organizationUrl>https://reloop.sh</organizationUrl>
30+
</developer>
31+
</developers>
32+
33+
<scm>
34+
<connection>scm:git:git://github.com/reloop-labs/reloop-java.git</connection>
35+
<developerConnection>scm:git:ssh://github.com:reloop-labs/reloop-java.git</developerConnection>
36+
<url>https://github.com/reloop-labs/reloop-java/tree/main</url>
37+
</scm>
38+
1939
<properties>
2040
<maven.compiler.source>17</maven.compiler.source>
2141
<maven.compiler.target>17</maven.compiler.target>
@@ -49,6 +69,57 @@
4969
<artifactId>maven-surefire-plugin</artifactId>
5070
<version>3.2.5</version>
5171
</plugin>
72+
<plugin>
73+
<groupId>org.apache.maven.plugins</groupId>
74+
<artifactId>maven-source-plugin</artifactId>
75+
<version>3.3.0</version>
76+
<executions>
77+
<execution>
78+
<id>attach-sources</id>
79+
<goals>
80+
<goal>jar-no-fork</goal>
81+
</goals>
82+
</execution>
83+
</executions>
84+
</plugin>
85+
<plugin>
86+
<groupId>org.apache.maven.plugins</groupId>
87+
<artifactId>maven-javadoc-plugin</artifactId>
88+
<version>3.6.3</version>
89+
<executions>
90+
<execution>
91+
<id>attach-javadocs</id>
92+
<goals>
93+
<goal>jar</goal>
94+
</goals>
95+
</execution>
96+
</executions>
97+
</plugin>
98+
<plugin>
99+
<groupId>org.apache.maven.plugins</groupId>
100+
<artifactId>maven-gpg-plugin</artifactId>
101+
<version>3.1.0</version>
102+
<executions>
103+
<execution>
104+
<id>sign-artifacts</id>
105+
<phase>verify</phase>
106+
<goals>
107+
<goal>sign</goal>
108+
</goals>
109+
</execution>
110+
</executions>
111+
</plugin>
112+
<plugin>
113+
<groupId>org.sonatype.central</groupId>
114+
<artifactId>central-publishing-maven-plugin</artifactId>
115+
<version>0.4.0</version>
116+
<extensions>true</extensions>
117+
<configuration>
118+
<publishingServerId>central</publishingServerId>
119+
<tokenAuth>true</tokenAuth>
120+
<autoPublish>true</autoPublish>
121+
</configuration>
122+
</plugin>
52123
</plugins>
53124
</build>
54125
</project>

0 commit comments

Comments
 (0)