fix: minePlots integration #622
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: Gradle Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '**.md' | |
| - '.gitignore' | |
| - 'LICENSE' | |
| pull_request: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '**.md' | |
| - '.gitignore' | |
| - 'LICENSE' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Validate Gradle wrapper | |
| uses: gradle/wrapper-validation-action@v2 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Make Gradle wrapper executable | |
| run: chmod +x ./gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew build --no-daemon | |
| - name: Run tests | |
| run: ./gradlew test --no-daemon | |
| - name: Extract version | |
| id: extract_version | |
| run: | | |
| VERSION=$(grep 'version =' build.gradle | head -n 1 | awk -F "'" '{print $2}') | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| COMMIT_SHA_SHORT=$(git rev-parse --short HEAD) | |
| echo "COMMIT_SHA_SHORT=$COMMIT_SHA_SHORT" >> $GITHUB_ENV | |
| echo "Version: $VERSION (Commit: $COMMIT_SHA_SHORT)" | |
| - name: Upload JAR artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: SmartSpawner-${{ env.VERSION }} | |
| path: core/build/libs/SmartSpawner-${{ env.VERSION }}.jar | |
| retention-days: 90 | |
| if-no-files-found: error | |
| - name: Upload test reports on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports-${{ env.COMMIT_SHA_SHORT }} | |
| path: build/reports/tests/ | |
| retention-days: 7 |