Skip to content

Commit 02c5559

Browse files
committed
try fixing build.yml #4
1 parent 0ab324d commit 02c5559

File tree

1 file changed

+16
-57
lines changed

1 file changed

+16
-57
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -23,72 +23,31 @@ jobs:
2323
- name: Grant execute permission for gradlew
2424
run: chmod +x gradlew
2525

26-
- name: Build all versions
26+
- name: Build all versions at once
2727
run: |
28-
mkdir -p all-builds
29-
30-
# List of all versions
31-
VERSIONS=(
32-
"1.16" "1.16.1" "1.16.2" "1.16.3" "1.16.4" "1.16.5"
33-
"1.17" "1.17.1" "1.18" "1.18.1" "1.18.2"
34-
"1.19" "1.19.1" "1.19.2" "1.19.3" "1.19.4"
35-
"1.20" "1.20.1" "1.20.2" "1.20.4" "1.20.6"
36-
"1.21" "1.21.1" "1.21.2" "1.21.3" "1.21.4" "1.21.5" "1.21.8"
37-
)
38-
39-
FAILED=""
40-
SUCCESS_COUNT=0
41-
42-
for VERSION in "${VERSIONS[@]}"; do
43-
echo "========================================="
44-
echo "Building MC $VERSION"
45-
echo "========================================="
46-
47-
BUILD_SUCCESS=false
48-
for attempt in 1 2 3; do
49-
echo "Attempt $attempt for MC $VERSION"
50-
51-
# Use --no-configuration-cache to avoid compatibility issues
52-
if ./gradlew "Set active project to $VERSION" --no-daemon --no-configuration-cache && \
53-
./gradlew build --no-daemon --no-configuration-cache; then
54-
cp build/libs/*.jar all-builds/ 2>/dev/null || true
55-
./gradlew clean --no-daemon --no-configuration-cache
56-
BUILD_SUCCESS=true
57-
SUCCESS_COUNT=$((SUCCESS_COUNT + 1))
58-
echo "✓ Successfully built MC $VERSION"
59-
break
60-
fi
28+
echo "========================================="
29+
echo "Building all GreenTextMod versions"
30+
echo "========================================="
6131
62-
if [ $attempt -lt 3 ]; then
63-
echo "Build failed, retrying in 10 seconds..."
64-
sleep 10
65-
./gradlew clean --no-daemon --no-configuration-cache || true
66-
fi
67-
done
32+
# Stonecutter builds all versions at once
33+
./gradlew build --no-daemon --no-configuration-cache
6834
69-
if [ "$BUILD_SUCCESS" = false ]; then
70-
echo "✗ Failed to build MC $VERSION after 3 attempts"
71-
FAILED="$FAILED $VERSION"
72-
fi
35+
echo "Build completed!"
36+
37+
- name: Collect built JARs
38+
run: |
39+
mkdir -p all-builds
7340
74-
echo ""
41+
# Find all built JAR files from version subdirectories
42+
find . -path "*/build/libs/*.jar" -type f | while read jar; do
43+
echo "Found: $jar"
44+
cp "$jar" all-builds/
7545
done
7646
77-
# Reset to default version
78-
./gradlew "Reset active project" --no-daemon --no-configuration-cache || true
79-
8047
echo "========================================="
8148
echo "Build Summary"
8249
echo "========================================="
83-
echo "Successfully built: $SUCCESS_COUNT/${#VERSIONS[@]} versions"
84-
echo "JAR files created: $(ls -1 all-builds/*.jar 2>/dev/null | wc -l)"
85-
86-
if [ -n "$FAILED" ]; then
87-
echo "Failed versions:$FAILED"
88-
echo "::warning::Some versions failed to build:$FAILED"
89-
fi
90-
91-
# List all built files
50+
echo "JAR files collected: $(ls -1 all-builds/*.jar 2>/dev/null | wc -l)"
9251
echo ""
9352
echo "Built files:"
9453
ls -la all-builds/*.jar 2>/dev/null || echo "No JAR files found"

0 commit comments

Comments
 (0)