From d78fe9fc842b8e6c1cf128c8f0a2d2bb0430d1fe Mon Sep 17 00:00:00 2001 From: Strongest Number 9 <16169054+StrongestNumber9@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:57:24 +0200 Subject: [PATCH] Updates workflows (#48) * Updates github/maven central release workflows * Delete trailing whitespace --- .github/workflows/upload_release.yaml | 39 ++++++++++-------- pom.xml | 57 ++++++++++++++------------- 2 files changed, 52 insertions(+), 44 deletions(-) diff --git a/.github/workflows/upload_release.yaml b/.github/workflows/upload_release.yaml index 75f4d4a..eb8c42e 100644 --- a/.github/workflows/upload_release.yaml +++ b/.github/workflows/upload_release.yaml @@ -2,7 +2,7 @@ name: Upload Release on: release: - types: published + types: [published] jobs: upload: @@ -18,34 +18,41 @@ jobs: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - - name: Setup Maven Central + - name: Setup Signing uses: actions/setup-java@v2 with: java-version: 8.0.292+10 distribution: 'adopt' - - server-id: ossrh - server-username: MAVEN_CENTRAL_USERNAME - server-password: MAVEN_CENTRAL_TOKEN - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} 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: - MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - - name: Setup GitHub Packages uses: actions/setup-java@v2 with: java-version: 8.0.292+10 distribution: 'adopt' - + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Publish to GitHub Packages run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-github-packages 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 }} diff --git a/pom.xml b/pom.xml index 16b0032..94cf98f 100644 --- a/pom.xml +++ b/pom.xml @@ -100,7 +100,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.0 attach-sources @@ -113,7 +113,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9.1 + 3.5.0 attach-javadocs @@ -185,22 +185,22 @@ 1.1.0 true - resolveCiFriendliesOnly + bom - flatten - process-resources + flatten.clean - flatten + clean + clean - flatten.clean - clean + flatten - clean + flatten + process-resources @@ -211,6 +211,18 @@ publish-maven-central + + org.sonatype.central + central-publishing-maven-plugin + 0.5.0 + true + + central-sonatype-org + true + true + validated + + org.apache.maven.plugins maven-gpg-plugin @@ -218,10 +230,10 @@ sign-artifacts - verify sign + verify --pinentry-mode @@ -233,20 +245,16 @@ + + + publish-github-packages - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - ossrh - Central Repository OSSRH - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + github + GitHub Packages + https://maven.pkg.github.com/teragrep/jla_01 - - - publish-github-packages @@ -256,10 +264,10 @@ sign-artifacts - verify sign + verify --pinentry-mode @@ -271,13 +279,6 @@ - - - github - GitHub Packages - https://maven.pkg.github.com/teragrep/jla_01 - -