Skip to content

Commit

Permalink
Create oss-publish.yml
Browse files Browse the repository at this point in the history
getting started with maven oss deployment
  • Loading branch information
jac18281828 authored Sep 7, 2020
1 parent 11bb1e9 commit d37c238
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/oss-publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit d37c238

Please sign in to comment.