build main ('New destination.') #3368
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: build | |
run-name: build ${{ github.ref_name }} ('${{ github.event.head_commit.message }}') | |
on: | |
push: | |
branches: [main, "REL-*"] | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest] | |
java: [ 21 ] | |
# also check (once) on latest | |
include: | |
- os: ubuntu-latest | |
java: 23 | |
runs-on: ${{ matrix.os }} | |
env: | |
MAVEN_ARGS: '--no-transfer-progress' | |
steps: | |
- name: Cancel previous Action | |
uses: styfle/[email protected] | |
continue-on-error: true # for act | |
- uses: actions/[email protected] | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
cache: maven | |
server-id: vpro-ossrh | |
server-username: SONATYPE_USERNAME | |
server-password: SONATYPE_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} | |
gpg-passphrase: GPG_SECRET_KEY_PASSPHRASE | |
- name: Build and deploy with Maven (Linux, java 21) | |
run: mvn -B -P"deploy,ossrh,npm" -U -fae deploy | |
if: runner.os == 'Linux' && matrix.java == '21' | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
GPG_SECRET_KEY_PASSPHRASE: ${{ secrets.GPG_SECRET_KEY_PASSPHRASE }} | |
- name: Show dependency updates | |
run: mvn versions:display-dependency-updates | |
if: runner.os == 'Linux' && matrix.java == '21' | |
- name: Build with Maven (Other os) | |
run: mvn -B -U -fae package | |
if: "! (runner.os == 'Linux' && matrix.java == '21')" | |
continue-on-error: true | |
- name: Publish to codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} # required | |
#files: "**/target/surefire-reports/*.xml" | |
if: "! cancelled() && github.ref == 'refs/heads/main' && runner.os == 'Linux' && matrix.java == '21'" | |
- name: Publish Unit Test Results | |
uses: EnricoMi/[email protected] | |
if: always() && runner.os == 'Linux' | |
with: | |
files: "**/target/surefire-reports/*.xml" | |
check_name: Tests results java ${{ matrix.java }}, os ${{ matrix.os }} | |
- name: Publish Unit Test Results (Windows) | |
uses: EnricoMi/publish-unit-test-result-action/windows/[email protected] | |
if: always() && runner.os == 'Windows' | |
with: | |
files: "**/target/surefire-reports/*.xml" | |
check_name: Tests results java ${{ matrix.java }}, os ${{ matrix.os }} | |