Skip to content

Commit a4c49fa

Browse files
authored
Merge pull request #10 from reeyur/feature/add-maven-publish
Feature/add maven publish
2 parents 199859a + 56e1658 commit a4c49fa

File tree

4 files changed

+72
-4
lines changed

4 files changed

+72
-4
lines changed

.github/workflows/maven.yml .github/workflows/build.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lyrebird Java Client CI
1+
name: Lyrebird Java Client Build and Test
22

33
on: [push, pull_request]
44

@@ -16,7 +16,6 @@ jobs:
1616
run: mvn clean verify
1717

1818
build:
19-
2019
runs-on: ubuntu-latest
2120

2221
steps:
@@ -26,4 +25,4 @@ jobs:
2625
with:
2726
java-version: 1.8
2827
- name: Build with Maven
29-
run: mvn package --file pom.xml
28+
run: mvn package --file pom.xml

.github/workflows/release.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lyrebird Java Client Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Set up JDK 1.8
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 1.8
18+
- name: Deploy to Github Package Registry
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
run:
22+
mvn --settings settings.xml deploy

pom.xml

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.meituan.lyrebird.sdk</groupId>
77
<artifactId>lyrebird-java-client</artifactId>
8-
<version>1.0.0</version>
8+
<version>1.0.1</version>
99
<build>
1010
<plugins>
1111
<plugin>
@@ -19,6 +19,14 @@
1919
</plugins>
2020
</build>
2121

22+
<distributionManagement>
23+
<repository>
24+
<id>github</id>
25+
<name>GitHub Meituan-Dianping Apache Maven Packages</name>
26+
<url>https://maven.pkg.github.com/Meituan-Dianping/lyrebird-java-client</url>
27+
</repository>
28+
</distributionManagement>
29+
2230
<dependencies>
2331
<dependency>
2432
<groupId>com.squareup.retrofit2</groupId>

settings.xml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
3+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
4+
5+
<activeProfiles>
6+
<activeProfile>github</activeProfile>
7+
</activeProfiles>
8+
9+
<profiles>
10+
<profile>
11+
<id>github</id>
12+
<repositories>
13+
<repository>
14+
<id>central</id>
15+
<url>https://repo1.maven.org/maven2</url>
16+
<releases>
17+
<enabled>true</enabled>
18+
</releases>
19+
<snapshots>
20+
<enabled>true</enabled>
21+
</snapshots>
22+
</repository>
23+
<repository>
24+
<id>github</id>
25+
<name>GitHub Meituan-Dianping Apache Maven Packages</name>
26+
<url>https://maven.pkg.github.com/Meituan-Dianping</url>
27+
</repository>
28+
</repositories>
29+
</profile>
30+
</profiles>
31+
32+
<servers>
33+
<server>
34+
<id>github</id>
35+
<username>X-Auth-Token</username>
36+
<password>${env.GITHUB_TOKEN}</password>
37+
</server>
38+
</servers>
39+
</settings>

0 commit comments

Comments
 (0)