Skip to content

fix: tweak code and tests to better support Java 21 #178

fix: tweak code and tests to better support Java 21

fix: tweak code and tests to better support Java 21 #178

Workflow file for this run

name: build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
maven-verify:
name: "Build on Java ${{ matrix.java }}"
strategy:
matrix:
java: [8, 11, 17, 21]
runs-on: ubuntu-latest
steps:
- name: "Checkout sources"
uses: actions/checkout@v2
- name: "Set up Java"
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: "temurin"
cache: 'maven'
- name: "Get Maven dependencies from cache"
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: "Build with Maven"
run: mvn --batch-mode verify
maven-deploy:
name: "Deploy snapshot to Sonatype OSSRH"
needs: maven-verify
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: "Checkout sources"
uses: actions/checkout@v2
- name: "Setup Java"
uses: actions/setup-java@v4
with:
java-version: 21
distribution: "temurin"
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
- name: "Get Maven dependencies from cache"
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: "Build and deploy to the Maven Central Repository"
run: mvn --batch-mode -DskipTests deploy
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}