Skip to content

Build with JDK 17 for Sonar #177

Build with JDK 17 for Sonar

Build with JDK 17 for Sonar #177

Workflow file for this run

name: Build project
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-version: wrapper
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
- name: Build and test
run: |
chmod +x gradlew
./gradlew clean build
- name: Analyse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
./gradlew sonar
- name: Publish to Maven Central
if: ${{ github.ref == 'refs/heads/develop' }}
env:
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
run:
./gradlew publish