ci: publish maven artifact (#116)

This commit is contained in:
LFC
2023-10-31 16:24:20 +08:00
committed by GitHub
parent d354d4f0f7
commit 5da72f1cae
2 changed files with 135 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
name: Maven Publish
on:
release:
types: [ created ]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Git Repo
uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Build with Maven
run: |
cd java
mvn clean deploy --batch-mode -DskipTests -P release -B -U -e
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
+103 -1
View File
@@ -5,7 +5,109 @@
<groupId>io.greptime</groupId>
<artifactId>greptimedb-proto</artifactId>
<version>0.1.0</version>
<version>0.4.0</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>GreptimeDB protobuf files for Java</description>
<url>https://github.com/GreptimeTeam/greptime-proto</url>
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>Jeremy</name>
<email>jiachun@greptime.com</email>
<organization>GreptimeTeam</organization>
<organizationUrl>https://greptime.com</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/GreptimeTeam/greptimedb-client-java.git</connection>
<developerConnection>scm:git:ssh://github.com:GreptimeTeam/greptimedb-client-java.git</developerConnection>
<url>https://github.com/GreptimeTeam/greptimedb-client-java/tree/main</url>
</scm>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<maven.compiler.source>8</maven.compiler.source>