Skip to content

Snapshot Builds

Snapshot Builds #298

Workflow file for this run

name: Snapshot Builds
on:
push:
branches: [ master ]
tags:
- '!refs/tags/*'
paths-ignore:
- '**/README.md'
- '**/.github/**'
pull_request:
branches: [ master ]
paths-ignore:
- '**/README.md'
- '**/.github/**'
jobs:
build-project:
name: 'Build, Test and Deploy'
runs-on: ubuntu-20.04
strategy:
matrix:
java: [ '8' ]
steps:
- uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
check-latest: true
cache: maven
- name: Build Java Project
run: mvn install -Dgpg.skip=true -DskipTests=true -B -V --file pom.xml
- name: Unit Tests
run: mvn test
- name: Integration Tests
run: mvn verify
- name: Set up for Sonatype
uses: actions/setup-java@v3
with: # running setup-java again overwrites the settings.xml
distribution: 'temurin'
java-version: ${{ matrix.java }}
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: SONATYPE_USERNAME # env variable for username in deploy
server-password: SONATYPE_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_AUTHOR_PRIVATEKEY }} # Value of the GPG private key to import
gpg-passphrase: GPG_AUTHOR_PASSPHRASE # env variable for GPG private key passphrase
cache: maven
- name: Publish to Sonatype (Snapshots)
if: github.event_name != 'pull_request' && github.event_name != 'release'
run: mvn -P'snapshot' --batch-mode deploy -DskipTests=true
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_AUTHOR_PASSPHRASE: ${{ secrets.GPG_AUTHOR_PASSPHRASE }}