Skip to content

Merge branch 'main' into develop #21

Merge branch 'main' into develop

Merge branch 'main' into develop #21

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- develop
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Check Maven module version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
if [[ $GITHUB_REF != 'refs/heads/main' && $VERSION != *"-SNAPSHOT"* ]]; then
echo "Skipping release version $VERSION on non-main branch"
exit 0
fi
- name: Import GPG private key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Build with Maven
run: mvn clean install
- name: Deploy to Sonatype Nexus
run: mvn deploy --settings settings.xml
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}