-
Notifications
You must be signed in to change notification settings - Fork 5
/
action.yml
42 lines (42 loc) · 1.56 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: "Setup Java build"
description: "Performs the setup of required build tools (eg.: Maven, Java)"
inputs:
java-version:
description: the desired Java version
default: "17"
required: false
java-distribution:
description: the desired Java distribution
default: "temurin"
required: false
maven-settings:
description: the location of the custom Maven settings.xml file to install
default: ".ci.settings.xml"
required: false
runs:
using: composite
steps:
- name: "Cache local Maven repository"
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Install ${{ inputs.maven-settings }}"
shell: bash
run: |
mkdir -p $HOME/.m2
if [ -f "${{ inputs.maven-settings }}" ]; then
echo "Installing Maven settings file found in the repository: ${{ inputs.maven-settings }}"
cp "${{ inputs.maven-settings }}" $HOME/.m2/settings.xml
else
echo "Maven settings file: ${{ inputs.maven-settings }} not found in the repository. Installing the default one"
cp ${{ github.action_path }}/settings.xml $HOME/.m2/settings.xml
fi
- name: "Set up Java"
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.java-distribution }}
overwrite-settings: false