Skip to content

update Build Status Badge #18

update Build Status Badge

update Build Status Badge #18

Workflow file for this run

# This workflow will check out the project, build it using Maven, and run
# unit tests every time someone pushes to the repo or a pull request is opened.
# For pushes to master, the project will also be packaged and deployed to Maven Central.
name: Maven
on: [ push, pull_request ]
jobs:
build_and_test:
name: Build and run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'
cache: maven
- name: Run tests with Maven
run: mvn test -B
deploy:
name: Deploy to Maven Central
runs-on: ubuntu-latest
needs: [ build_and_test ]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'
cache: maven
server-id: ossrh
server-username: SONATYPE_USERNAME
server-password: SONATYPE_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Maven Central
run: mvn deploy -B -Pfull,ossrh -DskipTests=true
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}