From d37c23894410c0fbfa3742dded0695578c1c91d2 Mon Sep 17 00:00:00 2001 From: John Cairns Date: Mon, 7 Sep 2020 06:56:03 -0500 Subject: [PATCH] Create oss-publish.yml getting started with maven oss deployment --- .github/workflows/oss-publish.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/oss-publish.yml diff --git a/.github/workflows/oss-publish.yml b/.github/workflows/oss-publish.yml new file mode 100644 index 0000000..92317fc --- /dev/null +++ b/.github/workflows/oss-publish.yml @@ -0,0 +1,31 @@ +# 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: Publish package to Maven Central Repository + +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: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + + - name: Build with Maven + run: mvn -B clean package javadoc:jar source:jar --file pom.xml + - name: Deploy with Maven + run: mvn -B gpg:sign deploy --file pom.xml + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}