Skip to content

Deploy artifacts

Deploy artifacts #6

Workflow file for this run

name: Deploy artifacts
on:
workflow_run:
workflows: [ 'Build and test' ]
types: [ 'completed' ]
branches: [ 'develop', 'master', 'main' ]
jobs:
build:
name: Deploy
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK and Maven Central deployment
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: |
8
21
mvn-toolchain-id: |
jdk8
jdk21
cache: maven
server-id: central
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-passphrase: MAVEN_GPG_PASSPHRASE
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Publish to Apache Maven Central
run: ./mvnw --batch-mode --no-snapshot-updates deploy -DskipTests -DskipLicenseCheck
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USER }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}