Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,26 @@ jobs:
- name: Assemble Resources
run: ./download-libs.sh

- name: Set up JDK 11
uses: actions/setup-java@v2
- name: Set up JDK 11 and Maven settings + GPG
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
distribution: 'temurin'
java-version: '11'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Check Maven version
run: mvn -version

- name: Update Version in pom.xml
run: mvn -B versions:set -DnewVersion=${{ github.event.inputs.packageVersion }} -DgenerateBackupPoms=false

- name: Publish Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
maven_args: "-e -X -Drevision=${{ github.event.inputs.packageVersion }}"
server_id: ossrh
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.MAVEN_USERNAME }}
nexus_password: ${{ secrets.MAVEN_PASSWORD }}
- name: Publish to Central Portal
run: mvn -B -e clean deploy -Pdeploy -Drevision=${{ github.event.inputs.packageVersion }}
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} # Central Portal token
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
28 changes: 28 additions & 0 deletions .github/workflows/test-maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test Maven Publish

on:
pull_request:
branches: ['**'] # Also on PRs to any branch

jobs:
test-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Assemble Resources
run: ./download-libs.sh

- name: Set up JDK 11 and Maven settings + GPG
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
server-id: central
server-username: ${{ secrets.MAVEN_USERNAME }}
server-password: ${{ secrets.MAVEN_PASSWORD }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Test Full Deploy (No Publishing)
run: mvn -B clean deploy -Pdeploy -Drevision=1.0.0-test -DskipPublishing=true -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
28 changes: 9 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
</licenses>

<organization>
<name>Cryptlex, LLC.</name>
<name>Cryptlex, LLP.</name>
<url>https://cryptlex.com</url>
</organization>

<developers>
<developer>
<name>Cryptlex Team</name>
<email>support@cryptlex.com</email>
<organization>Cryptlex, LLC.</organization>
<organization>Cryptlex, LLP.</organization>
<organizationUrl>https://cryptlex.com</organizationUrl>
</developer>
</developers>
Expand All @@ -50,17 +50,6 @@
</dependency>
</dependencies>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<properties>
<revision>1.0.0</revision>
<maven.test.skip>true</maven.test.skip>
Expand Down Expand Up @@ -92,14 +81,15 @@
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<tokenAuth>true</tokenAuth>
<waitUntil>published</waitUntil>
</configuration>
</plugin>

Expand Down