-
Notifications
You must be signed in to change notification settings - Fork 5
79 lines (74 loc) · 2.27 KB
/
maven.yml
File metadata and controls
79 lines (74 loc) · 2.27 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
# This workflow will build a Java project with Maven
# For more information see:
# https://help.github.com/actions/language-and-framework-guides
# /building-and-testing-java-with-maven
name: Maven
on:
push:
pull_request:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
permissions: {}
env:
MAVEN_OPTS: >
-Dhttps.protocols=TLSv1.2
-Dmaven.repo.local=.m2/repository
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN
-Dorg.slf4j.simpleLogger.showDateTime=true
-Djava.awt.headless=true
MAVEN_CLI_OPTS: >
--batch-mode
--errors
--fail-at-end
--show-version
-DinstallAtEnd=true
-DdeployAtEnd=true
jobs:
maven:
runs-on: ubuntu-latest
strategy:
matrix:
java: [17, 21, 25]
name: Java ${{ matrix.java }}
steps:
- name: Set REPOSITORY
shell: bash
run: |
set -euo pipefail
IFS=$'\n\t'
echo "REPOSITORY=${GITHUB_REPOSITORY#*/}" >> "${GITHUB_ENV}"
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false
- name: Set SOURCE_DATE_EPOCH
run: |
set -euo pipefail
IFS=$'\n\t'
echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> "${GITHUB_ENV}"
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Build with Maven
shell: bash
run: |
set -euo pipefail
# Do not set IFS=$'\n\t', breaks ${MAVEN_CLI_OPTS}
# shellcheck disable=SC2086 # [Double quote to prevent globbing and word splitting]: splitting is desired for MAVEN_CLI_OPTS
./mvnw ${MAVEN_CLI_OPTS} -DdependencyCheck.skip=true verify
- name: Upload artifacts
if: ${{ matrix.java == 17 }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ env.REPOSITORY }}
path: target/
- name: Clean up
shell: bash
run: |
set -euo pipefail
IFS=$'\n\t'
rm "${HOME}/.m2/settings.xml"