Skip to content

Commit

Permalink
publish using actions
Browse files Browse the repository at this point in the history
  • Loading branch information
szhnet committed Sep 26, 2023
1 parent 0ad61b4 commit d918515
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
File renamed without changes.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish package to the Maven Central Repository

on:
release:
types: [released]

jobs:
release:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Publish package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
17 changes: 12 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@
</developers>

<scm>
<url>https://github.com/szhnet/kcp-netty</url>
<connection>scm:git:git://github.com/szhnet/kcp-netty.git</connection>
<url>git@github.com:szhnet/kcp-netty.git</url>
<connection>scm:git:${project.scm.url}</connection>
<developerConnection>scm:git:${project.scm.url}</developerConnection>
</scm>

<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-staging</id>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
Expand Down Expand Up @@ -199,6 +200,12 @@
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
Expand All @@ -207,7 +214,7 @@
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
Expand Down

0 comments on commit d918515

Please sign in to comment.