Skip to content

Commit

Permalink
workflow updated
Browse files Browse the repository at this point in the history
  • Loading branch information
power-lin committed Jun 24, 2022
1 parent 14efd75 commit 526e3fb
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 42 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
type: boolean
default: false
jobs:
build:
maven_deploy:
runs-on: ubuntu-latest

steps:
Expand All @@ -26,19 +26,21 @@ jobs:
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to the Maven Central Repository
if: ${{ github.event.inputs.auto_release == 'false'}}
run: mvn deploy -B -DskipTests -pl :parent,:cat-client
run: mvn deploy -B -DskipTests -pl :parent,:cat-client -P github-action
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Publish and release to the Maven Central Repository
if: ${{ github.event.inputs.auto_release == 'true'}}
#test Action
run: mvn deploy -B -DskipTests -pl :parent,:cat-client && mvn nexus-staging:release -B
run: mvn deploy -B -DskipTests -pl :parent,:cat-client -Ddeploy.autoRelease=true -P github-action
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_TOKEN }}

MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
96 changes: 59 additions & 37 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
Expand Down Expand Up @@ -117,9 +117,9 @@
<version>6.1.14</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
Expand All @@ -139,7 +139,7 @@
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>2.4.1</version>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
Expand All @@ -152,30 +152,30 @@
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.8</version>
</dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
Expand All @@ -187,15 +187,15 @@
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.9</version>
</dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.9</version>
</dependency>
<dependency>
<groupId>com.mchange.v2</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.1</version>
</dependency>
<groupId>com.mchange.v2</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
Expand All @@ -214,6 +214,27 @@
</plugins>
</build>
</profile>
<profile>
<id>github-action</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<pluginManagement>
Expand Down Expand Up @@ -258,7 +279,7 @@ org.eclipse.jdt.core.compiler.compliance=1.7
<file>
<name>.settings/org.eclipse.core.resources.prefs</name>
<content>
<![CDATA[
<![CDATA[
eclipse.preferences.version=1
encoding/<project>=UTF-8
]]>
Expand All @@ -280,12 +301,12 @@ org.eclipse.jdt.core.compiler.compliance=1.7
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<autoReleaseAfterClose>${deploy.autoRelease}</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
Expand All @@ -307,7 +328,7 @@ org.eclipse.jdt.core.compiler.compliance=1.7
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -381,6 +402,7 @@ org.eclipse.jdt.core.compiler.compliance=1.7
</pluginRepositories>
<properties>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<deploy.autoRelease>false</deploy.autoRelease>
</properties>
<distributionManagement>
<snapshotRepository>
Expand Down

0 comments on commit 526e3fb

Please sign in to comment.