diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 689076a264..0c207099ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,6 +27,13 @@ jobs: matrix: java_version: ['8', '11', '17', '21', '22'] os: ['ubuntu-22.04'] + include: + - java_version: '8' + os: 'ubuntu-22.04' + release_build: 'R' + - java_version: '8' + os: 'windows-latest' + is_windows: 'W' env: JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1" steps: @@ -47,22 +54,24 @@ jobs: run: ./mvnw -B -q -ff -ntp verify - name: Extract project Maven version id: projectVersion + # for some reason fails on Windows; we don't need it so skip: + if: ${{ !matrix.is_windows }} run: echo "version=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.3.0:evaluate -DforceStdout -Dexpression=project.version -q)" >>$GITHUB_OUTPUT - name: Verify Android SDK Compatibility - if: matrix.java_version == '8' + if: ${{ matrix.release_build }} run: ./mvnw -B -q -ff -ntp -DskipTests animal-sniffer:check - name: Deploy snapshot - if: ${{ github.event_name != 'pull_request' && matrix.java_version == '8' && endsWith(steps.projectVersion.outputs.version, '-SNAPSHOT') }} + if: ${{ github.event_name != 'pull_request' && matrix.release_build && endsWith(steps.projectVersion.outputs.version, '-SNAPSHOT') }} env: CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} # MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} run: ./mvnw -B -q -ff -DskipTests -ntp source:jar deploy - name: Generate code coverage - if: ${{ github.event_name != 'pull_request' && matrix.java_version == '8' }} + if: ${{ github.event_name != 'pull_request' && matrix.release_build }} run: ./mvnw -B -q -ff -ntp test - name: Publish code coverage - if: ${{ github.event_name != 'pull_request' && matrix.java_version == '8' }} + if: ${{ github.event_name != 'pull_request' && matrix.release_build }} uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0 with: token: ${{ secrets.CODECOV_TOKEN }}