try fixing build.yml #4 #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build All Versions | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| jobs: | |
| build-all: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build all versions at once | |
| run: | | |
| echo "=========================================" | |
| echo "Building all GreenTextMod versions" | |
| echo "=========================================" | |
| # Stonecutter builds all versions at once | |
| ./gradlew build --no-daemon --no-configuration-cache | |
| echo "Build completed!" | |
| - name: Collect built JARs | |
| run: | | |
| mkdir -p all-builds | |
| # Find all built JAR files from version subdirectories | |
| find . -path "*/build/libs/*.jar" -type f | while read jar; do | |
| echo "Found: $jar" | |
| cp "$jar" all-builds/ | |
| done | |
| echo "=========================================" | |
| echo "Build Summary" | |
| echo "=========================================" | |
| echo "JAR files collected: $(ls -1 all-builds/*.jar 2>/dev/null | wc -l)" | |
| echo "" | |
| echo "Built files:" | |
| ls -la all-builds/*.jar 2>/dev/null || echo "No JAR files found" | |
| - name: Upload all builds | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GreenTextMod-all-versions | |
| path: all-builds/*.jar | |
| if-no-files-found: warn | |
| retention-days: 30 |