From 8d946bbdff108d86660c50fce5cb87ca08a4c527 Mon Sep 17 00:00:00 2001 From: Christian Tzolov Date: Tue, 28 Jan 2025 10:50:15 +0100 Subject: [PATCH] initial maven central relese configuraitons --- .github/workflows/maven-central-release.yml | 38 ++++++++++ pom.xml | 81 +++++++++++++-------- 2 files changed, 87 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/maven-central-release.yml diff --git a/.github/workflows/maven-central-release.yml b/.github/workflows/maven-central-release.yml new file mode 100644 index 0000000..4d67ce0 --- /dev/null +++ b/.github/workflows/maven-central-release.yml @@ -0,0 +1,38 @@ +name: Release to Maven Central + +on: + push: + tags: + - 'v*' + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Build and Test + run: mvn clean verify + + - name: Publish to Maven Central + run: | + mvn --batch-mode \ + -Prelease \ + -Pjavadoc \ + deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} diff --git a/pom.xml b/pom.xml index 97dd9a2..8462e58 100644 --- a/pom.xml +++ b/pom.xml @@ -26,12 +26,12 @@ https://spring.io - - - MIT License - http://www.opensource.org/licenses/mit-license.php - - + + + MIT License + http://www.opensource.org/licenses/mit-license.php + + @@ -51,13 +51,11 @@ https://github.com/modelcontextprotocol/java-sdk/actions - - spring-snapshots - https://repo.spring.io/libs-snapshot-local - - false - - + + ossrh + Central Repository OSSRH + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + @@ -299,26 +297,45 @@ - artifactory-staging + relesae + + + + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 + true + + central + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + - spring-staging - https://repo.spring.io/libs-staging-local - - false - - - - - - artifactory-milestone - - - spring-milestones - https://repo.spring.io/libs-milestone-local - - false - + ossrh + Central Repository OSSRH + https://oss.sonatype.org/service/local/staging/deploy/maven2/ @@ -365,4 +382,4 @@ - + \ No newline at end of file