Skip to content

Commit 5990ab1

Browse files
authored
Merge pull request #32 from yutaipu/feature/20200828_file_push_push_cancel
Feature/20200828 file push push cancel
2 parents b5012ad + e077bdf commit 5990ab1

File tree

7 files changed

+117
-73
lines changed

7 files changed

+117
-73
lines changed

.classpath

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/maven.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish package to the Maven Central Repository
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up JDK 1.8
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: 1.8
16+
17+
- name: Build with Maven
18+
run: mvn -B clean package -Dmaven.test.skip
19+
20+
- name: Set up Apache Maven Central
21+
uses: actions/setup-java@v1
22+
with: # running setup-java again overwrites the settings.xml
23+
java-version: 1.8
24+
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
25+
server-username: MAVEN_USERNAME # env variable for username in deploy
26+
server-password: MAVEN_PASSWORD # env variable for token in deploy
27+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
28+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
29+
30+
- name: Publish to Apache Maven Central
31+
run: mvn deploy -Dmaven.test.skip
32+
env:
33+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
34+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
35+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ hs_err_pid*
1717
/target/
1818
pom.xml.releaseBackup
1919
release.properties
20+
21+
.classpath
22+
.project

.project

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void testSendPushWithCallback() {
6161
<dependency>
6262
<groupId>cn.jpush.api</groupId>
6363
<artifactId>jiguang-common</artifactId>
64-
<version>1.1.4</version>
64+
<version>1.1.9</version>
6565
</dependency>
6666
<dependency>
6767
<groupId>com.google.code.gson</groupId>

pom.xml

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>cn.jpush.api</groupId>
55
<artifactId>jiguang-common</artifactId>
6-
<version>1.1.8</version>
6+
<version>1.1.9-SNAPSHOT</version>
77
<packaging>jar</packaging>
88
<url>https://github.com/jpush/jiguang-java-client-common</url>
99
<name>Jiguang Client Common Dependencies</name>
@@ -169,9 +169,82 @@
169169
</dependencies>
170170
</plugin>
171171

172+
<!-- 参考 https://docs.github.com/cn/actions/language-and-framework-guides/publishing-java-packages-with-maven#about-package-configuration -->
173+
<!-- 参考 https://github.com/actions/setup-java -->
174+
<!-- 参考 https://central.sonatype.org/pages/apache-maven.html -->
175+
176+
<!-- Javadoc和源代码附件 -->
177+
<plugin>
178+
<groupId>org.apache.maven.plugins</groupId>
179+
<artifactId>maven-source-plugin</artifactId>
180+
<version>2.2.1</version>
181+
<executions>
182+
<execution>
183+
<id>attach-sources</id>
184+
<goals>
185+
<goal>jar-no-fork</goal>
186+
</goals>
187+
</execution>
188+
</executions>
189+
</plugin>
190+
<plugin>
191+
<groupId>org.apache.maven.plugins</groupId>
192+
<artifactId>maven-javadoc-plugin</artifactId>
193+
<version>2.9.1</version>
194+
<executions>
195+
<execution>
196+
<id>attach-javadocs</id>
197+
<goals>
198+
<goal>jar</goal>
199+
</goals>
200+
</execution>
201+
</executions>
202+
</plugin>
203+
204+
<!-- GPG签名组件 -->
205+
<plugin>
206+
<groupId>org.apache.maven.plugins</groupId>
207+
<artifactId>maven-gpg-plugin</artifactId>
208+
<version>1.5</version>
209+
<executions>
210+
<execution>
211+
<id>sign-artifacts</id>
212+
<phase>verify</phase>
213+
<goals>
214+
<goal>sign</goal>
215+
</goals>
216+
</execution>
217+
</executions>
218+
</plugin>
219+
220+
<!-- Nexus Staging Maven插件,用于部署和发布 -->
221+
<plugin>
222+
<groupId>org.sonatype.plugins</groupId>
223+
<artifactId>nexus-staging-maven-plugin</artifactId>
224+
<version>1.6.7</version>
225+
<extensions>true</extensions>
226+
<configuration>
227+
<serverId>ossrh</serverId>
228+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
229+
<!-- 手动release -->
230+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
231+
</configuration>
232+
</plugin>
233+
172234
</plugins>
173235
</build>
174236

237+
<distributionManagement>
238+
<snapshotRepository>
239+
<id>ossrh</id>
240+
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
241+
</snapshotRepository>
242+
<repository>
243+
<id>ossrh</id>
244+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
245+
</repository>
246+
</distributionManagement>
247+
175248
<reporting>
176249
<plugins>
177250

src/main/java/cn/jiguang/common/ClientConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public class ClientConfig extends HashMap<String, Object> {
2222
public static final String PUSH_PATH = "push.path";
2323
public static final Object PUSH_PATH_SCHEMA = String.class;
2424

25+
public static final String FILE_PUSH_PATH = "file.push.path";
26+
public static final Object FILE_PUSH_PATH_SCHEMA = String.class;
27+
2528
public static final String BATCH_REGID_PUSH_PATH = "batch.regid.path";
2629
public static final Object BATCH_REGID_PUSH_PATH_SCHEMA = String.class;
2730

@@ -130,6 +133,7 @@ private ClientConfig() {
130133

131134
this.put(PUSH_HOST_NAME, "https://api.jpush.cn");
132135
this.put(PUSH_PATH, "/v3/push");
136+
this.put(FILE_PUSH_PATH, "/v3/push/file");
133137
this.put(BATCH_REGID_PUSH_PATH, "/v3/push/batch/regid/single");
134138
this.put(BATCH_ALIAS_PUSH_PATH, "/v3/push/batch/alias/single");
135139
this.put(PUSH_VALIDATE_PATH, "/v3/push/validate");

0 commit comments

Comments
 (0)