File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,12 +28,30 @@ jobs:
2828 with :
2929 ref : ${{ matrix.branch }}
3030
31+ - name : Resolve CI Java / build task
32+ id : ci_meta
33+ run : |
34+ # Prefer values from the checked-out branch; fall back to matrix / defaults.
35+ JAVA=$(grep -E '^[[:space:]]*ci_java_version[[:space:]]*=' gradle.properties | tail -1 | cut -d= -f2- | tr -d ' \r' || true)
36+ TASK=$(grep -E '^[[:space:]]*ci_build_task[[:space:]]*=' gradle.properties | tail -1 | cut -d= -f2- | tr -d ' \r' || true)
37+ if [ -z "$JAVA" ]; then JAVA='${{ matrix.java }}'; fi
38+ if [ -z "$TASK" ]; then TASK='${{ matrix.build_task }}'; fi
39+ echo "java=${JAVA:-21}" >> "$GITHUB_OUTPUT"
40+ echo "task=${TASK:-remapJar}" >> "$GITHUB_OUTPUT"
41+ echo "Branch ${{ matrix.branch }} -> java=${JAVA:-21} task=${TASK:-remapJar}"
42+ java -version || true
43+
3144 - name : Set up JDK
3245 uses : actions/setup-java@v4
3346 with :
34- java-version : ${{ matrix .java }}
47+ java-version : ${{ steps.ci_meta.outputs .java }}
3548 distribution : ' temurin'
3649
50+ - name : Verify Java
51+ run : |
52+ echo "JAVA_HOME=$JAVA_HOME"
53+ java -version
54+
3755 - name : Cache gradle files
3856 uses : actions/cache@v4
3957 with :
5068 run : chmod +x gradlew
5169
5270 - name : Build with Gradle
53- run : ./gradlew ${{ matrix.build_task }} --no-daemon
71+ run : ./gradlew ${{ steps.ci_meta.outputs.task }} --no-daemon
5472 env :
5573 BUILD_TAG : ${{ inputs.tag }}
5674 BUILD_ID : ${{ github.run_number }}
Original file line number Diff line number Diff line change 1616 required : false
1717 description : Git ref/branch to checkout; empty uses the triggering ref
1818 default : ' '
19- java_version :
20- type : string
21- required : false
22- description : JDK major version
23- default : ' 21'
24- build_task :
25- type : string
26- required : false
27- description : Gradle task to run
28- default : ' remapJar'
2919 artifact_name :
3020 type : string
3121 required : false
@@ -47,10 +37,19 @@ jobs:
4737 with :
4838 ref : ${{ inputs.ref }}
4939
40+ - name : Resolve CI Java / build task
41+ id : ci_meta
42+ run : |
43+ JAVA=$(grep -E '^[[:space:]]*ci_java_version[[:space:]]*=' gradle.properties | tail -1 | cut -d= -f2- | tr -d ' \r' || true)
44+ TASK=$(grep -E '^[[:space:]]*ci_build_task[[:space:]]*=' gradle.properties | tail -1 | cut -d= -f2- | tr -d ' \r' || true)
45+ echo "java=${JAVA:-21}" >> "$GITHUB_OUTPUT"
46+ echo "task=${TASK:-remapJar}" >> "$GITHUB_OUTPUT"
47+ echo "Resolved ci_java_version=${JAVA:-21} ci_build_task=${TASK:-remapJar}"
48+
5049 - name : Set up JDK
5150 uses : actions/setup-java@v4
5251 with :
53- java-version : ${{ inputs.java_version }}
52+ java-version : ${{ steps.ci_meta.outputs.java }}
5453 distribution : ' temurin'
5554
5655 - name : Cache gradle files
6867 run : chmod +x gradlew
6968
7069 - name : Build with Gradle
71- run : ./gradlew ${{ inputs.build_task }} --no-daemon
70+ run : ./gradlew ${{ steps.ci_meta.outputs.task }} --no-daemon
7271 env :
7372 BUILD_TAG : ${{ inputs.tag }}
7473 BUILD_ID : ${{ github.run_number }}
Original file line number Diff line number Diff line change @@ -16,3 +16,7 @@ fabric_api_version = 0.91.6+1.20.2
1616neoforge_version = 20.2.93
1717
1818incremental_storage_lib_version =1.3.0+build.26030517.05
19+
20+ # CI build settings (read by GitHub Actions after checkout)
21+ ci_java_version = 21
22+ ci_build_task = remapJar
You can’t perform that action at this time.
0 commit comments