From 6c37d27873813cbdaee2dcecb6d88de3c7f77021 Mon Sep 17 00:00:00 2001 From: xstefank Date: Mon, 8 Dec 2025 15:32:23 +0100 Subject: [PATCH 1/2] fix: release process for 5.0.x Signed-off-by: xstefank --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e7826ce613..1ceb5b2b6c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,6 +30,10 @@ jobs: echo "Setting version_branch to v4" echo "tmp_version_branch=v4" >> "$GITHUB_ENV" - if: ${{ startsWith(github.event.release.tag_name, 'v5.' ) }} + run: | + echo "Setting version_branch to 5.0.x" + echo "tmp_version_branch=5.0.x" >> "$GITHUB_ENV" + - if: ${{ startsWith(github.event.release.tag_name, 'v6.' ) }} run: | echo "Setting version_branch to main" echo "tmp_version_branch=main" >> "$GITHUB_ENV" From bdff1ab7ecb7e051e4021facebba08335b6b889c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Wed, 16 Jul 2025 15:27:50 +0200 Subject: [PATCH 2/2] improve: release process (#2861) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit see details: https://central.sonatype.org/publish/publish-portal-maven/#usage see sample also here: https://github.com/teamlead/java-maven-sonatype-starter/tree/master Signed-off-by: Attila Mészáros (cherry picked from commit 50a90f1ef6a323c03388d7bf88d280579bb2e973) --- .github/workflows/release-project-in-dir.yml | 20 ++++++++++-------- .github/workflows/snapshot-releases.yml | 22 ++++++++++++-------- pom.xml | 13 ++++++------ 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release-project-in-dir.yml b/.github/workflows/release-project-in-dir.yml index dc79b6f6c2..02280d5a1f 100644 --- a/.github/workflows/release-project-in-dir.yml +++ b/.github/workflows/release-project-in-dir.yml @@ -29,6 +29,11 @@ jobs: java-version: 17 distribution: temurin cache: 'maven' + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE - name: Change version to release version # Assume that RELEASE_VERSION will have form like: "v1.0.1". So we cut the "v" @@ -37,15 +42,12 @@ jobs: env: RELEASE_VERSION: ${{ github.event.release.tag_name }} - - name: Release Maven package - uses: samuelmeuli/action-maven-publish@v1 - with: - maven_profiles: "release" - maven_args: ${{ env.MAVEN_ARGS }} - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} - nexus_username: ${{ secrets.OSSRH_USERNAME }} - nexus_password: ${{ secrets.OSSRH_TOKEN }} + - name: Publish to Apache Maven Central + run: mvn package deploy -Prelease + env: + MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} # This is separate job because there were issues with git after release step, was not able to commit changes. update-working-version: diff --git a/.github/workflows/snapshot-releases.yml b/.github/workflows/snapshot-releases.yml index 66fe9d25a3..f9219d1278 100644 --- a/.github/workflows/snapshot-releases.yml +++ b/.github/workflows/snapshot-releases.yml @@ -33,14 +33,18 @@ jobs: - name: Set up Java and Maven uses: actions/setup-java@v4 with: - distribution: temurin java-version: 17 + distribution: temurin cache: 'maven' - - name: Release Maven package - uses: samuelmeuli/action-maven-publish@v1 - with: - maven_profiles: "release" - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} - nexus_username: ${{ secrets.OSSRH_USERNAME }} - nexus_password: ${{ secrets.OSSRH_TOKEN }} + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Publish to Apache Maven Central + run: mvn package deploy -Prelease + env: + MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} diff --git a/pom.xml b/pom.xml index d07f1e4884..2b84cfe5b8 100644 --- a/pom.xml +++ b/pom.xml @@ -545,14 +545,15 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - ${nexus-staging-maven-plugin.version} + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 true - ossrh - https://oss.sonatype.org/ - true + central + true + true + published