Skip to content

Build, Test, and Release #21

Build, Test, and Release

Build, Test, and Release #21

Workflow file for this run

name: Build, Test, and Release
on:
push:
branches:
- 'master'
- 'main'
- 'develop'
workflow_dispatch:
jobs:
build_test_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
architecture: x64
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build
run: mvn -DskipTests -B clean package
- name: Test
run: mvn -B test
- name: Sources
run: mvn -B source:jar
- name: Install
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
run: mvn -B install
- name: Javadoc
run: mvn -B javadoc:jar
- name: Publish to the Maven Central Repository
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
run: mvn -B deploy