Skip to content

Commit

Permalink
Merge pull request #6 from yahoojapan/mnagaya/github_actions
Browse files Browse the repository at this point in the history
Add maven.yml and maven-publish.yml
  • Loading branch information
takamabe authored Nov 10, 2020
2 parents 7cdc847 + b907bec commit c0f5e7a
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path

name: Maven Package

on:
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file pom.xml -Dvespa.version='7.244.2'

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy:deploy-file@deploy-file -s $GITHUB_WORKSPACE/settings.xml -Dvespa.version='7.244.2'
env:
GITHUB_TOKEN: ${{ github.token }}
24 changes: 24 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build with Maven
run: mvn -B package --file pom.xml -Dvespa.version='7.244.2'
22 changes: 22 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,28 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<id>deploy-file</id>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<file>./target/${project.artifactId}-${project.version}-deploy.jar</file>
<repositoryId>github</repositoryId>
<url>https://maven.pkg.github.com/yahoojapan/vespa-kuromoji-linguistics</url>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<token>${env.GITHUB_TOKEN}</token>
<packaging>jar</packaging>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit c0f5e7a

Please sign in to comment.