Skip to content

Commit aaf9f64

Browse files
committed
add maven deploy action
1 parent f7a60e7 commit aaf9f64

File tree

8 files changed

+79
-104
lines changed

8 files changed

+79
-104
lines changed

.github/workflows/publish.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Maven Publish
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
publish:
7+
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
steps:
14+
- name: Checkout main branch & Change path to client
15+
uses: actions/checkout@v2
16+
with:
17+
ref: 'master'
18+
- name: Set Java Env
19+
uses: actions/setup-java@v2
20+
with:
21+
java-version: '8'
22+
distribution: 'adopt'
23+
server-id: ossrh
24+
server-username: MAVEN_USERNAME
25+
server-password: MAVEN_PASSWORD
26+
27+
28+
- name: Release Maven package
29+
uses: samuelmeuli/action-maven-publish@v1
30+
with:
31+
gpg_private_key: ${{ secrets.GPG_SECRET }}
32+
gpg_passphrase: ${{ secrets.GPG_PASSWD }}
33+
nexus_username: ${{ secrets.OSSRH_USER }}
34+
nexus_password: ${{ secrets.OSSRH_PASSWD }}
35+
maven_args: -Dmaven.test.skip=true -Dgpg.skip=false
36+
maven_profiles: deploy
37+
env:
38+
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
39+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWD }}

brpc-java-examples/brpc-java-core-examples/pom.xml

-18
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,6 @@
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3636
</properties>
3737

38-
<profiles>
39-
<profile>
40-
<id>release</id>
41-
<build>
42-
<plugins>
43-
<plugin>
44-
<groupId>org.apache.maven.plugins</groupId>
45-
<artifactId>maven-deploy-plugin</artifactId>
46-
<version>2.8.2</version>
47-
<configuration>
48-
<skip>true</skip>
49-
</configuration>
50-
</plugin>
51-
</plugins>
52-
</build>
53-
</profile>
54-
</profiles>
55-
5638
<build>
5739
<plugins>
5840
<plugin>

brpc-java-examples/brpc-spring-boot-examples/brpc-spring-boot-examples-api/pom.xml

+1-17
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,7 @@
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3636
</properties>
3737

38-
<profiles>
39-
<profile>
40-
<id>release</id>
41-
<build>
42-
<plugins>
43-
<plugin>
44-
<groupId>org.apache.maven.plugins</groupId>
45-
<artifactId>maven-deploy-plugin</artifactId>
46-
<version>2.8.2</version>
47-
<configuration>
48-
<skip>true</skip>
49-
</configuration>
50-
</plugin>
51-
</plugins>
52-
</build>
53-
</profile>
54-
</profiles>
38+
5539

5640
<dependencies>
5741
<dependency>

brpc-java-examples/brpc-spring-boot-examples/brpc-spring-boot-examples-client/pom.xml

-17
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,6 @@
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3636
</properties>
3737

38-
<profiles>
39-
<profile>
40-
<id>release</id>
41-
<build>
42-
<plugins>
43-
<plugin>
44-
<groupId>org.apache.maven.plugins</groupId>
45-
<artifactId>maven-deploy-plugin</artifactId>
46-
<version>2.8.2</version>
47-
<configuration>
48-
<skip>true</skip>
49-
</configuration>
50-
</plugin>
51-
</plugins>
52-
</build>
53-
</profile>
54-
</profiles>
5538

5639
<dependencyManagement>
5740
<dependencies>

brpc-java-examples/pom.xml

+17-14
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,22 @@
4141
<module>spring-cloud-brpc-examples</module>
4242
</modules>
4343

44-
<build>
45-
<pluginManagement>
46-
<plugins>
47-
<plugin>
48-
<groupId>org.apache.maven.plugins</groupId>
49-
<artifactId>maven-deploy-plugin</artifactId>
50-
<version>2.8.2</version>
51-
<configuration>
52-
<skip>true</skip>
53-
</configuration>
54-
</plugin>
55-
</plugins>
56-
</pluginManagement>
57-
</build>
44+
<profiles>
45+
<profile>
46+
<id>deploy</id>
47+
<build>
48+
<plugins>
49+
<plugin>
50+
<groupId>org.apache.maven.plugins</groupId>
51+
<artifactId>maven-deploy-plugin</artifactId>
52+
<version>2.8.2</version>
53+
<configuration>
54+
<skip>true</skip>
55+
</configuration>
56+
</plugin>
57+
</plugins>
58+
</build>
59+
</profile>
60+
</profiles>
5861

5962
</project>

brpc-java-examples/spring-cloud-brpc-examples/spring-cloud-brpc-examples-api/pom.xml

+1-17
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,7 @@
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3636
</properties>
3737

38-
<profiles>
39-
<profile>
40-
<id>release</id>
41-
<build>
42-
<plugins>
43-
<plugin>
44-
<groupId>org.apache.maven.plugins</groupId>
45-
<artifactId>maven-deploy-plugin</artifactId>
46-
<version>2.8.2</version>
47-
<configuration>
48-
<skip>true</skip>
49-
</configuration>
50-
</plugin>
51-
</plugins>
52-
</build>
53-
</profile>
54-
</profiles>
38+
5539

5640
<dependencies>
5741
<dependency>

brpc-java-examples/spring-cloud-brpc-examples/spring-cloud-brpc-examples-client/pom.xml

-17
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,6 @@
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3636
</properties>
3737

38-
<profiles>
39-
<profile>
40-
<id>release</id>
41-
<build>
42-
<plugins>
43-
<plugin>
44-
<groupId>org.apache.maven.plugins</groupId>
45-
<artifactId>maven-deploy-plugin</artifactId>
46-
<version>2.8.2</version>
47-
<configuration>
48-
<skip>true</skip>
49-
</configuration>
50-
</plugin>
51-
</plugins>
52-
</build>
53-
</profile>
54-
</profiles>
5538

5639
<dependencyManagement>
5740
<dependencies>

pom.xml

+21-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<module>brpc-spring</module>
5151
<module>brpc-spring-boot-starter</module>
5252
<module>spring-cloud-brpc</module>
53-
<module>brpc-java-examples</module>
53+
<!--<module>brpc-java-examples</module>-->
5454
</modules>
5555

5656
<issueManagement>
@@ -88,7 +88,7 @@
8888

8989
<profiles>
9090
<profile>
91-
<id>release</id>
91+
<id>deploy</id>
9292
<build>
9393
<plugins>
9494
<plugin>
@@ -104,6 +104,23 @@
104104
</goals>
105105
</execution>
106106
</executions>
107+
<configuration>
108+
<gpgArguments>
109+
<arg>--pinentry-mode</arg>
110+
<arg>loopback</arg>
111+
</gpgArguments>
112+
</configuration>
113+
</plugin>
114+
<plugin>
115+
<groupId>org.sonatype.plugins</groupId>
116+
<artifactId>nexus-staging-maven-plugin</artifactId>
117+
<version>1.6.7</version>
118+
<extensions>true</extensions>
119+
<configuration>
120+
<serverId>ossrh</serverId>
121+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
122+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
123+
</configuration>
107124
</plugin>
108125
<plugin>
109126
<groupId>org.apache.maven.plugins</groupId>
@@ -129,11 +146,11 @@
129146
</build>
130147
<distributionManagement>
131148
<snapshotRepository>
132-
<id>oss</id>
149+
<id>ossrh</id>
133150
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
134151
</snapshotRepository>
135152
<repository>
136-
<id>oss</id>
153+
<id>ossrh</id>
137154
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
138155
</repository>
139156
</distributionManagement>

0 commit comments

Comments
 (0)