Skip to content

Commit

Permalink
Re-adds maven central (#59)
Browse files Browse the repository at this point in the history
* Re-adds maven central

* Use newer maven central publishing

* Updates pom.xml
  • Loading branch information
StrongestNumber9 authored Aug 5, 2024
1 parent 6c2cbec commit 1792693
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 12 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/upload_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,20 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Setup Maven Central
uses: actions/setup-java@v2
with:
java-version: 8.0.292+10
distribution: 'adopt'
server-id: central-sonatype-org
server-username: CENTRAL_SONATYPE_ORG_USERNAME
server-password: CENTRAL_SONATYPE_ORG_PASSWORD
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to Maven Central
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-maven-central
env:
CENTRAL_SONATYPE_ORG_USERNAME: ${{ secrets.CENTRAL_SONATYPE_ORG_USERNAME }}
CENTRAL_SONATYPE_ORG_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_ORG_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
36 changes: 24 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,19 +260,42 @@
<profiles>
<profile>
<id>publish-maven-central</id>
<distributionManagement>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.4.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central-sonatype-org</publishingServerId>
<tokenAuth>true</tokenAuth>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<phase>verify</phase>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
Expand All @@ -284,17 +307,6 @@
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
<profile>
<id>publish-github-packages</id>
Expand Down

0 comments on commit 1792693

Please sign in to comment.