diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index b88cc1b..b40f62d 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -42,11 +42,16 @@ 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 @@ -54,12 +59,9 @@ jobs: - 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 }} diff --git a/.github/workflows/test-maven-publish.yml b/.github/workflows/test-maven-publish.yml new file mode 100644 index 0000000..491f1ce --- /dev/null +++ b/.github/workflows/test-maven-publish.yml @@ -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 }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index a506b12..55edecc 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ - Cryptlex, LLC. + Cryptlex, LLP. https://cryptlex.com @@ -26,7 +26,7 @@ Cryptlex Team support@cryptlex.com - Cryptlex, LLC. + Cryptlex, LLP. https://cryptlex.com @@ -50,17 +50,6 @@ - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - - 1.0.0 true @@ -92,14 +81,15 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 true - ossrh - https://s01.oss.sonatype.org/ - true + central + true + true + published