mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
50 lines
2.1 KiB
YAML
50 lines
2.1 KiB
YAML
name: 'Prepare Gradle Build'
|
|
description: 'Prepares a Gradle build. Sets up Java and Gradle and configures Gradle properties'
|
|
inputs:
|
|
java-version:
|
|
required: false
|
|
default: '17'
|
|
description: 'The Java version to use for the build'
|
|
java-toolchain:
|
|
required: false
|
|
default: false
|
|
description: 'Whether a Java toolchain should be used'
|
|
develocity-access-key:
|
|
required: false
|
|
description: 'The access key for authentication with ge.spring.io'
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Free Disk Space
|
|
if: ${{ runner.os == 'Linux' }}
|
|
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
|
|
with:
|
|
docker-images: false
|
|
- name: Set Up Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'liberica'
|
|
java-version: |
|
|
${{ inputs.java-version }}
|
|
${{ inputs.java-toolchain == 'true' && '17' || '' }}
|
|
- name: Set Up Gradle
|
|
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
|
|
with:
|
|
cache-read-only: false
|
|
develocity-access-key: ${{ inputs.develocity-access-key }}
|
|
- name: Configure Gradle Properties
|
|
shell: bash
|
|
run: |
|
|
mkdir -p $HOME/.gradle
|
|
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
|
|
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
|
|
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
|
|
- name: Configure Toolchain Properties
|
|
if: ${{ inputs.java-toolchain == 'true' }}
|
|
shell: bash
|
|
run: |
|
|
echo toolchainVersion=${{ inputs.java-version }} >> $HOME/.gradle/gradle.properties
|
|
echo systemProp.org.gradle.java.installations.auto-detect=false >> $HOME/.gradle/gradle.properties
|
|
echo systemProp.org.gradle.java.installations.auto-download=false >> $HOME/.gradle/gradle.properties
|
|
echo systemProp.org.gradle.java.installations.paths=${{ format('$JAVA_HOME_{0}_X64', inputs.java-version) }} >> $HOME/.gradle/gradle.properties
|