try cicd #1
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 | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| classifier: [windows-x86_64, linux-x86_64, linux-aarch64, macos-x86_64, macos-aarch64] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| - name: Replace classifier in build.gradle | |
| run: sed -i 's/windows-x86_64/${{ matrix.classifier }}/g' build.gradle | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew build | |
| - name: Rename output JAR | |
| run: for file in build/libs/*.jar; do if [[ "$file" != *"-sources.jar" && "$file" != *"-api.jar" && "$file" != *"-dev.jar" ]]; then mv "$file" "${file%.jar}-${{ matrix.classifier }}.jar"; fi; done | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mod-${{ matrix.classifier }} | |
| path: build/libs/*-${{ matrix.classifier }}.jar |