Skip to content

Commit d918515

Browse files
committed
publish using actions
1 parent 0ad61b4 commit d918515

File tree

3 files changed

+38
-5
lines changed

3 files changed

+38
-5
lines changed
File renamed without changes.

.github/workflows/publish.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish package to the Maven Central Repository
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
release:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up JDK 8
15+
uses: actions/setup-java@v3
16+
with:
17+
java-version: '8'
18+
distribution: 'temurin'
19+
cache: maven
20+
- name: Publish package
21+
uses: samuelmeuli/action-maven-publish@v1
22+
with:
23+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
24+
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
25+
nexus_username: ${{ secrets.NEXUS_USERNAME }}
26+
nexus_password: ${{ secrets.NEXUS_PASSWORD }}

pom.xml

+12-5
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,18 @@
3939
</developers>
4040

4141
<scm>
42-
<url>https://github.com/szhnet/kcp-netty</url>
43-
<connection>scm:git:git://github.com/szhnet/kcp-netty.git</connection>
42+
<url>[email protected]:szhnet/kcp-netty.git</url>
43+
<connection>scm:git:${project.scm.url}</connection>
44+
<developerConnection>scm:git:${project.scm.url}</developerConnection>
4445
</scm>
4546

4647
<distributionManagement>
4748
<snapshotRepository>
48-
<id>sonatype-nexus-staging</id>
49+
<id>ossrh</id>
4950
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
5051
</snapshotRepository>
5152
<repository>
52-
<id>sonatype-nexus-staging</id>
53+
<id>ossrh</id>
5354
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
5455
</repository>
5556
</distributionManagement>
@@ -199,6 +200,12 @@
199200
<goals>
200201
<goal>sign</goal>
201202
</goals>
203+
<configuration>
204+
<gpgArguments>
205+
<arg>--pinentry-mode</arg>
206+
<arg>loopback</arg>
207+
</gpgArguments>
208+
</configuration>
202209
</execution>
203210
</executions>
204211
</plugin>
@@ -207,7 +214,7 @@
207214
<artifactId>nexus-staging-maven-plugin</artifactId>
208215
<extensions>true</extensions>
209216
<configuration>
210-
<serverId>sonatype-nexus-staging</serverId>
217+
<serverId>ossrh</serverId>
211218
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
212219
<autoReleaseAfterClose>false</autoReleaseAfterClose>
213220
</configuration>

0 commit comments

Comments
 (0)