name: test

on: [push]

jobs:
  test:
    strategy:
       matrix:
         java: [8, 11.0.3, 11, 13, 17.0.1, 17, 18-ea]	
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Set up Java
      uses: actions/setup-java@v1
      with:
        java-version: ${{ matrix.java }}
    - name: Maven Test
      run: ./mvnw clean test	
  deploy:
    needs: test
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Set up Java 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8		
    - name: Deploy to Sonatype
      run: ./mvnw -B -Drepo.username=${{secrets.SONATYPE_USERNAME}} -Drepo.password=${{secrets.SONATYPE_PASSWORD}} clean deploy -DskipTests=true --settings mySettings.xml

name: test

on: [push]

jobs:
  test:
    strategy:
       matrix:
         java: [1.8, 11.0.3, 11, 13, 17.0.1, 17, 18-ea]	
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Set up Java
      uses: actions/setup-java@v1
      with:
        java-version: ${{ matrix.java }}
    - name: Maven Test
      run: ./mvnw clean test	
  deploy:
    needs: test
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Set up Java ${{ matrix.java }}
      uses: actions/setup-java@v1
      with:
        java-version: 1.8	
    - name: Deploy to Sonatype
      run: ./mvnw -B -Drepo.username=${{secrets.SONATYPE_USERNAME}} -Drepo.password=${{secrets.SONATYPE_PASSWORD}} clean deploy -DskipTests=true --settings mySettings.xml

Revert the chosen deployed version.
Revert the chosen deployed version.

The tests continue to test many versions of OpenJDKs, but only deploys the latest of for Java 8. Keep in mind JDK 8 updates will stop or eol soon according to support license announcements.