From b38b20b807c62b135f5701144e0845f648ecf373 Mon Sep 17 00:00:00 2001 From: Yauhenikapl Date: Mon, 16 Jun 2025 19:35:48 +0300 Subject: [PATCH 1/3] Change a publish plugin for Maven Central --- .github/workflows/release-workflow.yml | 41 ++++++++++++++++---------- documentation/pom.xml | 17 +++++++---- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml index eeabf7431..2af90a4d2 100644 --- a/.github/workflows/release-workflow.yml +++ b/.github/workflows/release-workflow.yml @@ -301,8 +301,8 @@ jobs: distribution: 'temurin' java-version: '21' server-id: ossrh - server-username: OSSRH_USERNAME - server-password: OSSRH_TOKEN + server-username: CENTRAL_SONATYPE_TOKEN_USERNAME + server-password: CENTRAL_SONATYPE_TOKEN_PASSWORD overwrite-settings: false # Required to run the mvn:versions, since enforcer plugin @@ -316,6 +316,15 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} native-image-job-reports: 'false' + - name: Configure GPG + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + gpg-private-key: GPG_PRIVATE_KEY + gpg-passphrase: GPG_PASSPHRASE + overwrite-settings: false + - name: Fetch Linux Artifacts uses: actions/download-artifact@v4 with: @@ -419,23 +428,23 @@ jobs: # is the undocumented rc-list-profiles command of the # nexus-staging-maven-plugin: # mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:rc-list-profiles -DnexusUrl=https://oss.sonatype.org/ -DserverId=ossrh - - name: Release to OSSRH/Maven Central + - name: Release to Maven Central if: ${{ !contains( github.event.inputs.release_version, '-M' ) }} run: | - mkdir deploy - mv nexus-staging deploy - cd deploy - mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:deploy-staged-repository \ - -DnexusUrl=https://oss.sonatype.org/ \ - -DserverId=ossrh \ - -DrepositoryDirectory=nexus-staging \ - -DstagingProfileId=7e73217781f2e + mvn -B -pl '!org.eclipse.esmf:samm-cli' clean deploy -Psign +# run: | +# mkdir deploy +# mv nexus-staging deploy +# cd deploy +# mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13:deploy-staged-repository \ +# -DnexusUrl=https://oss.sonatype.org/ \ +# -DserverId=ossrh \ +# -DrepositoryDirectory=nexus-staging \ +# -DstagingProfileId=7e73217781f2e env: - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} - # Workaround for https://issues.sonatype.org/browse/OSSRH-66257 - # as described in https://stackoverflow.com/a/70157413 - MAVEN_OPTS: --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED + CENTRAL_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }} + CENTRAL_TOKEN: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }} + PGP_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY }} # Milestone release: Write settings to deploy to Github repo - name: Write settings.xml diff --git a/documentation/pom.xml b/documentation/pom.xml index 838fef192..9067cb1d0 100644 --- a/documentation/pom.xml +++ b/documentation/pom.xml @@ -138,12 +138,19 @@ + + + + + + + + - org.sonatype.plugins - nexus-staging-maven-plugin - - true - + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 + true From a1af65d20148eb92a39d0a54f5d9ca0156c4ed3c Mon Sep 17 00:00:00 2001 From: Yauhenikapl Date: Wed, 18 Jun 2025 15:06:04 +0300 Subject: [PATCH 2/3] Update workflow file --- .github/workflows/release-workflow.yml | 15 ++++----------- documentation/pom.xml | 3 +++ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml index 2af90a4d2..6c66f0c6c 100644 --- a/.github/workflows/release-workflow.yml +++ b/.github/workflows/release-workflow.yml @@ -103,7 +103,7 @@ jobs: release_version=${{ github.event.inputs.release_version }} # Actual build of core SDK - mvn -B -pl '!org.eclipse.esmf:samm-cli' clean deploy -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -DaltDeploymentRepository=local::default::file://nexus-staging -Psign + mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 # Build samm-cli executable jar and run integration tests unset JAVA_TOOL_OPTIONS mvn -B -pl tools/samm-cli clean verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 @@ -137,7 +137,7 @@ jobs: with: name: linux-artifacts path: | - nexus-staging/ + / samm-cli-${{ github.event.inputs.release_version }}-linux-x86_64.tar.gz samm-cli-${{ github.event.inputs.release_version }}.jar samm-cli-${{ github.event.inputs.release_version }}-javadoc.jar @@ -303,6 +303,8 @@ jobs: server-id: ossrh server-username: CENTRAL_SONATYPE_TOKEN_USERNAME server-password: CENTRAL_SONATYPE_TOKEN_PASSWORD + gpg-private-key: GPG_PRIVATE_KEY + gpg-passphrase: GPG_PASSPHRASE overwrite-settings: false # Required to run the mvn:versions, since enforcer plugin @@ -316,15 +318,6 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} native-image-job-reports: 'false' - - name: Configure GPG - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - gpg-private-key: GPG_PRIVATE_KEY - gpg-passphrase: GPG_PASSPHRASE - overwrite-settings: false - - name: Fetch Linux Artifacts uses: actions/download-artifact@v4 with: diff --git a/documentation/pom.xml b/documentation/pom.xml index 9067cb1d0..d8e972386 100644 --- a/documentation/pom.xml +++ b/documentation/pom.xml @@ -151,6 +151,9 @@ central-publishing-maven-plugin 0.7.0 true + + true + From 492b4897a8433692e60ce582ed6fc7780eceec4f Mon Sep 17 00:00:00 2001 From: Yauhenikapl Date: Wed, 18 Jun 2025 15:31:39 +0300 Subject: [PATCH 3/3] Update workflow file --- .github/workflows/release-workflow.yml | 5 ++--- documentation/pom.xml | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml index 6c66f0c6c..63d24af68 100644 --- a/.github/workflows/release-workflow.yml +++ b/.github/workflows/release-workflow.yml @@ -102,7 +102,7 @@ jobs: release_version=${{ github.event.inputs.release_version }} - # Actual build of core SDK + # Actual build of core SDK mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 # Build samm-cli executable jar and run integration tests unset JAVA_TOOL_OPTIONS @@ -137,7 +137,6 @@ jobs: with: name: linux-artifacts path: | - / samm-cli-${{ github.event.inputs.release_version }}-linux-x86_64.tar.gz samm-cli-${{ github.event.inputs.release_version }}.jar samm-cli-${{ github.event.inputs.release_version }}-javadoc.jar @@ -424,7 +423,7 @@ jobs: - name: Release to Maven Central if: ${{ !contains( github.event.inputs.release_version, '-M' ) }} run: | - mvn -B -pl '!org.eclipse.esmf:samm-cli' clean deploy -Psign + mvn -B -pl '!org.eclipse.esmf:samm-cli,!org.eclipse.esmf:documentation' clean deploy -Psign # run: | # mkdir deploy # mv nexus-staging deploy diff --git a/documentation/pom.xml b/documentation/pom.xml index d8e972386..9067cb1d0 100644 --- a/documentation/pom.xml +++ b/documentation/pom.xml @@ -151,9 +151,6 @@ central-publishing-maven-plugin 0.7.0 true - - true -