initial maven central relese configuraitons
This commit is contained in:
parent
0f62a508ce
commit
8d946bbdff
2 changed files with 87 additions and 32 deletions
38
.github/workflows/maven-central-release.yml
vendored
Normal file
38
.github/workflows/maven-central-release.yml
vendored
Normal file
|
|
@ -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 }}
|
||||||
67
pom.xml
67
pom.xml
|
|
@ -51,13 +51,11 @@
|
||||||
<url>https://github.com/modelcontextprotocol/java-sdk/actions</url>
|
<url>https://github.com/modelcontextprotocol/java-sdk/actions</url>
|
||||||
</ciManagement>
|
</ciManagement>
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<snapshotRepository>
|
<repository>
|
||||||
<id>spring-snapshots</id>
|
<id>ossrh</id>
|
||||||
<url>https://repo.spring.io/libs-snapshot-local</url>
|
<name>Central Repository OSSRH</name>
|
||||||
<releases>
|
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||||
<enabled>false</enabled>
|
</repository>
|
||||||
</releases>
|
|
||||||
</snapshotRepository>
|
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
@ -299,26 +297,45 @@
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>artifactory-staging</id>
|
<id>relesae</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.sonatype.central</groupId>
|
||||||
|
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||||
|
<version>0.7.0</version>
|
||||||
|
<extensions>true</extensions>
|
||||||
|
<configuration>
|
||||||
|
<publishingServerId>central</publishingServerId>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-gpg-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>sign-artifacts</id>
|
||||||
|
<phase>verify</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>sign</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<gpgArguments>
|
||||||
|
<arg>--pinentry-mode</arg>
|
||||||
|
<arg>loopback</arg>
|
||||||
|
</gpgArguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spring-staging</id>
|
<id>ossrh</id>
|
||||||
<url>https://repo.spring.io/libs-staging-local</url>
|
<name>Central Repository OSSRH</name>
|
||||||
<snapshots>
|
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||||
<enabled>false</enabled>
|
|
||||||
</snapshots>
|
|
||||||
</repository>
|
|
||||||
</distributionManagement>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>artifactory-milestone</id>
|
|
||||||
<distributionManagement>
|
|
||||||
<repository>
|
|
||||||
<id>spring-milestones</id>
|
|
||||||
<url>https://repo.spring.io/libs-milestone-local</url>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>false</enabled>
|
|
||||||
</snapshots>
|
|
||||||
</repository>
|
</repository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue