Skip to content

Commit

Permalink
Merge pull request #10 from reeyur/feature/add-maven-publish
Browse files Browse the repository at this point in the history
Feature/add maven publish
  • Loading branch information
yury-awesome authored Sep 26, 2019
2 parents 199859a + 56e1658 commit a4c49fa
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/maven.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lyrebird Java Client CI
name: Lyrebird Java Client Build and Test

on: [push, pull_request]

Expand All @@ -16,7 +16,6 @@ jobs:
run: mvn clean verify

build:

runs-on: ubuntu-latest

steps:
Expand All @@ -26,4 +25,4 @@ jobs:
with:
java-version: 1.8
- name: Build with Maven
run: mvn package --file pom.xml
run: mvn package --file pom.xml
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lyrebird Java Client Release

on:
push:
tags:
- 'v*'

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Deploy to Github Package Registry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
mvn --settings settings.xml deploy
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.meituan.lyrebird.sdk</groupId>
<artifactId>lyrebird-java-client</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<build>
<plugins>
<plugin>
Expand All @@ -19,6 +19,14 @@
</plugins>
</build>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Meituan-Dianping Apache Maven Packages</name>
<url>https://maven.pkg.github.com/Meituan-Dianping/lyrebird-java-client</url>
</repository>
</distributionManagement>

<dependencies>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
Expand Down
39 changes: 39 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">

<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>

<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>github</id>
<name>GitHub Meituan-Dianping Apache Maven Packages</name>
<url>https://maven.pkg.github.com/Meituan-Dianping</url>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>X-Auth-Token</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
</settings>

0 comments on commit a4c49fa

Please sign in to comment.