Skip to content

fix: minePlots integration #622

fix: minePlots integration

fix: minePlots integration #622

Workflow file for this run

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