Files
app/.github/actions/setup-java-gradle/action.yml
denis0001-dev 16aa55947e Inject git metadata into AppBuildInfo for About and legal links
Pass gitCommitSha and gitHubRepository from CI Gradle properties and local
git remote, generate them in AppBuildInfo, and resolve repo-relative legal
markdown links to GitHub blob URLs. Extend About with commit and license
links; keep EN/RU strings in sync.
2026-10-31 17:00:41 +03:00

67 lines
2.4 KiB
YAML

name: Setup Java and Gradle
description: Temurin JDK 17 + Gradle wrapper with dependency and build cache
inputs:
java-architecture:
description: Optional JDK architecture (x64). Omit for host default.
required: false
default: ""
java-distribution:
description: >
Distribution for the Gradle JVM (default temurin). Adoptium publishes no Windows aarch64
build for Java 17, so Windows ARM64 has to ask for zulu.
required: false
default: temurin
desktop-jdk:
description: >
Optional desktop JDK version. When set, a Zulu build of it is installed and exported as
FROMCHAT_PACKAGING_JDK. Needed by anything that runs Compose Desktop's release/ProGuard
tasks: Adoptium stopped shipping the jmods/ directory in JDK 25 archives, and the Compose
plugin derives ProGuard's -libraryjars by walking <javaHome>/jmods. A JDK without jmods
leaves ProGuard with no java.* classes at all, so the build dies on ~1.3M
"can't find superclass or interface java.lang.Object" warnings. Zulu still ships jmods.
required: false
default: ""
cache-read-only:
description: Restore Gradle User Home only; do not save (avoids parallel cache write races).
required: false
default: "false"
runs:
using: composite
steps:
# Installed first so setup-java leaves JAVA_HOME on Temurin 17 below: Gradle itself and the
# Android build must keep running on 17.
- uses: actions/setup-java@v5
if: inputs.desktop-jdk != ''
id: desktop-jdk
with:
distribution: zulu
java-version: ${{ inputs.desktop-jdk }}
- uses: actions/setup-java@v5
with:
distribution: ${{ inputs.java-distribution }}
java-version: "17"
architecture: ${{ inputs.java-architecture }}
- name: Export Gradle build metadata
shell: bash
run: |
{
echo "ORG_GRADLE_PROJECT_gitCommitSha=${{ github.sha }}"
echo "ORG_GRADLE_PROJECT_gitHubRepository=${{ github.repository }}"
} >> "$GITHUB_ENV"
- name: Export the jmods-capable desktop JDK
if: inputs.desktop-jdk != ''
shell: bash
run: echo "FROMCHAT_PACKAGING_JDK=${{ steps.desktop-jdk.outputs.path }}" >> "$GITHUB_ENV"
- uses: gradle/actions/setup-gradle@v5
with:
gradle-version: wrapper
cache-read-only: ${{ inputs.cache-read-only == 'true' }}
cache-overwrite-existing: true
add-job-summary: on-failure