Fix release build #790
Workflow file for this run
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 | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
matrix-build: | |
strategy: | |
matrix: | |
java: [21] | |
os: ['ubuntu-latest', 'windows-latest'] | |
env: | |
DEFAULT_JAVA: 21 | |
DEFAULT_OS: 'ubuntu-latest' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.java }} | |
cancel-in-progress: true | |
name: Build on ${{ matrix.os }} with Java ${{ matrix.java }} | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: read | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Cache SonarQube packages | |
uses: actions/cache@v4 | |
if: ${{ env.DEFAULT_JAVA == matrix.java && env.DEFAULT_OS == matrix.os }} | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-java-${{ matrix.java }}-sonar | |
restore-keys: ${{ runner.os }}-java-${{ matrix.java }}-sonar | |
- name: Build with Gradle using Java ${{ matrix.java }} | |
run: | | |
./gradlew build --info --warning-mode=summary -PskipFlakyTests=true -PjavaVersion=${{ matrix.java }} | |
- name: Archive executable JAR | |
uses: actions/upload-artifact@v4 | |
if: ${{ env.DEFAULT_JAVA == matrix.java && env.DEFAULT_OS == matrix.os }} | |
with: | |
name: executable-jar | |
retention-days: 5 | |
path: | | |
jfxui/build/libs/white-rabbit-fx-*.jar | |
jfxui/build/libs-checksums/* | |
if-no-files-found: error | |
- name: Archive test reports for ${{ matrix.os }} using Java ${{ matrix.java }} | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: test-reports-${{ matrix.os }}-java-${{ matrix.java }} | |
retention-days: 5 | |
path: "**/build/reports/tests/*/**" | |
if-no-files-found: error | |
- name: Sonar analysis | |
if: ${{ env.DEFAULT_JAVA == matrix.java && env.DEFAULT_OS == matrix.os && env.SONAR_TOKEN != null }} | |
run: | | |
./gradlew sonarqube -Dsonar.token=$SONAR_TOKEN --info --warning-mode=summary -PjavaVersion=${{ matrix.java }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Build native package for ${{ runner.os }} using Java ${{ matrix.java }} | |
if: ${{ env.DEFAULT_JAVA == matrix.java }} | |
run: | | |
./gradlew jpackage --info --warning-mode=summary -PjavaVersion=${{ matrix.java }} | |
- name: Archive native package for ${{ runner.os }} | |
uses: actions/upload-artifact@v4 | |
if: ${{ env.DEFAULT_JAVA == matrix.java }} | |
with: | |
name: packages-${{ runner.os }} | |
retention-days: 5 | |
path: | | |
jfxui/build/jpackage-dist/* | |
jfxui/build/jpackage-checksums/* | |
if-no-files-found: error | |
build: | |
needs: matrix-build | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Build successful" |