mirror of
https://github.com/LITW-Refined/GTNH-Actions-Workflows.git
synced 2025-12-26 11:28:30 +00:00
Dynamically use java 25 for v2 buildscripts and 21 for v1
This commit is contained in:
32
.github/workflows/build-and-test.yml
vendored
32
.github/workflows/build-and-test.yml
vendored
@@ -31,27 +31,39 @@ jobs:
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y mesa-utils xvfb x11-xserver-utils
|
||||
- name: Checkout mod repo
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Checkout workflows repo
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: GTNewHorizons/GTNH-Actions-Workflows
|
||||
path: .gtnh-workflows
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Determine JDK versions
|
||||
id: list-jdk-versions
|
||||
shell: bash
|
||||
run: |
|
||||
(
|
||||
echo 'java-versions<<EOF'
|
||||
echo 8
|
||||
echo 17
|
||||
echo 21
|
||||
if [[ -f gradle/gradle-daemon-jvm.properties ]]; then
|
||||
yq -pprops -oprops '.toolchainVersion' gradle/gradle-daemon-jvm.properties
|
||||
fi
|
||||
echo EOF
|
||||
) | tee -a "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Set up JDK versions
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: |
|
||||
8
|
||||
17
|
||||
21
|
||||
java-version: ${{ steps.list-jdk-versions.outputs.java-versions }}
|
||||
distribution: 'zulu'
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
with:
|
||||
build-scan-publish: true
|
||||
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
|
||||
@@ -68,7 +80,7 @@ jobs:
|
||||
run: ./gradlew --build-cache --info --stacktrace assemble
|
||||
|
||||
- name: Attach compilation artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: ${{ github.repository_id }}-build-libs
|
||||
path: build/libs/
|
||||
@@ -80,7 +92,7 @@ jobs:
|
||||
|
||||
- name: Attach gradle reports
|
||||
if: failure() && steps.build_mod.conclusion == 'failure'
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: ${{ github.repository_id }}-reports
|
||||
|
||||
Reference in New Issue
Block a user