Skip to content

Commit 87b7b73

Browse files
author
Usukhbayar
committed
Add Maven Central publish workflow and metadata
1 parent 9888c43 commit 87b7b73

2 files changed

Lines changed: 109 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish to Maven Central
2+
on:
3+
release:
4+
types: [published]
5+
workflow_dispatch:
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-java@v4
12+
with:
13+
java-version: "17"
14+
distribution: "temurin"
15+
server-id: central
16+
server-username: MAVEN_USERNAME
17+
server-password: MAVEN_PASSWORD
18+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
19+
gpg-passphrase: GPG_PASSPHRASE
20+
- name: Build
21+
run: mvn -B compile
22+
- name: Test
23+
run: mvn -B test
24+
- name: Publish
25+
run: mvn -B deploy -DskipTests
26+
env:
27+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
28+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
29+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

pom.xml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,40 @@
1111

1212
<name>QPay Java SDK</name>
1313
<description>Java SDK for QPay V2 API</description>
14+
<url>https://github.com/qpay-sdk/qpay-java</url>
15+
16+
<licenses>
17+
<license>
18+
<name>MIT License</name>
19+
<url>https://opensource.org/licenses/MIT</url>
20+
<distribution>repo</distribution>
21+
</license>
22+
</licenses>
23+
24+
<developers>
25+
<developer>
26+
<id>qpay-sdk</id>
27+
<name>QPay SDK Authors</name>
28+
<url>https://github.com/qpay-sdk</url>
29+
</developer>
30+
</developers>
31+
32+
<scm>
33+
<connection>scm:git:git://github.com/qpay-sdk/qpay-java.git</connection>
34+
<developerConnection>scm:git:ssh://github.com:qpay-sdk/qpay-java.git</developerConnection>
35+
<url>https://github.com/qpay-sdk/qpay-java</url>
36+
</scm>
37+
38+
<distributionManagement>
39+
<snapshotRepository>
40+
<id>central</id>
41+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
42+
</snapshotRepository>
43+
<repository>
44+
<id>central</id>
45+
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
46+
</repository>
47+
</distributionManagement>
1448

1549
<properties>
1650
<maven.compiler.source>17</maven.compiler.source>
@@ -57,6 +91,52 @@
5791
<artifactId>maven-surefire-plugin</artifactId>
5892
<version>3.2.5</version>
5993
</plugin>
94+
<plugin>
95+
<groupId>org.apache.maven.plugins</groupId>
96+
<artifactId>maven-source-plugin</artifactId>
97+
<version>3.3.1</version>
98+
<executions>
99+
<execution>
100+
<id>attach-sources</id>
101+
<goals>
102+
<goal>jar-no-fork</goal>
103+
</goals>
104+
</execution>
105+
</executions>
106+
</plugin>
107+
<plugin>
108+
<groupId>org.apache.maven.plugins</groupId>
109+
<artifactId>maven-javadoc-plugin</artifactId>
110+
<version>3.6.3</version>
111+
<executions>
112+
<execution>
113+
<id>attach-javadocs</id>
114+
<goals>
115+
<goal>jar</goal>
116+
</goals>
117+
</execution>
118+
</executions>
119+
</plugin>
120+
<plugin>
121+
<groupId>org.apache.maven.plugins</groupId>
122+
<artifactId>maven-gpg-plugin</artifactId>
123+
<version>3.2.4</version>
124+
<executions>
125+
<execution>
126+
<id>sign-artifacts</id>
127+
<phase>verify</phase>
128+
<goals>
129+
<goal>sign</goal>
130+
</goals>
131+
<configuration>
132+
<gpgArguments>
133+
<arg>--pinentry-mode</arg>
134+
<arg>loopback</arg>
135+
</gpgArguments>
136+
</configuration>
137+
</execution>
138+
</executions>
139+
</plugin>
60140
</plugins>
61141
</build>
62142
</project>

0 commit comments

Comments
 (0)