From e68565dddbde525e2294a04c859efbce913d68aa Mon Sep 17 00:00:00 2001 From: Naohide Sano Date: Fri, 28 Oct 2022 07:50:05 +0900 Subject: [PATCH] use github packages instead of jitpack --- .github/workflows/maven-publish.yml | 39 +++++++++++++++++++++++++++++ README.md | 2 +- pom.xml | 7 ++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/maven-publish.yml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 0000000..519c597 --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,39 @@ +name: GitHub Packages + +on: + release: + types: [created] + +jobs: + build: + + runs-on: macos-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 1.8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'temurin' + cache: maven + 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 + env: + DOCOMO_GOO_HIRAGANA_API_KEY : ${{ secrets.DOCOMO_GOO_HIRAGANA_API_KEY }} + RECRUIT_PROOFREADING_API_KEY : ${{ secrets.RECRUIT_PROOFREADING_API_KEY }} + YAHOOJAPAN_API_KEY : ${{ secrets.YAHOOJAPAN_API_KEY }} + GOOGLE_APPLICATION_CREDENTIALS : 'tmp/google.json' + GOOGLE : ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} + GITHUB_TOKEN: ${{ github.token }} + run: | + mkdir tmp + echo "$GOOGLE" > tmp/google.json + mvn -B package --file pom.xml -s $GITHUB_WORKSPACE/settings.xml + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml -Dmaven.test.skip=true + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/README.md b/README.md index 6386718..65ec9c9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Release](https://jitpack.io/v/umjammer/vavi-speech.svg)](https://jitpack.io/#umjammer/vavi-speech) +[![GitHub Packages](https://github.com/umjammer/vavi-speech/actions/workflows/maven-publish.yml/badge.svg)](https://github.com/umjammer?tab=packages&repo_name=vavi-speech) [![Java CI with Maven](https://github.com/umjammer/vavi-speech/workflows/Java%20CI%20with%20Maven/badge.svg)](https://github.com/umjammer/vavi-speech/actions) [![CodeQL](https://github.com/umjammer/vavi-speech/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/umjammer/vavi-speech/actions/workflows/codeql-analysis.yml) ![Java](https://img.shields.io/badge/Java-8-b07219) diff --git a/pom.xml b/pom.xml index e228617..1c3ddd7 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,13 @@ TODO 0.8.4 + + + github + https://maven.pkg.github.com/umjammer/vavi-speech + + + local (not on CI)