Skip to content

Add hook for SimpleClaimSystem2 #823

Add hook for SimpleClaimSystem2

Add hook for SimpleClaimSystem2 #823

Workflow file for this run

name: Gradle build
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
- '.gitignore'
- 'LICENSE'
- 'docs/**'
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
- '.gitignore'
- 'LICENSE'
- 'docs/**'
workflow_dispatch:
# Cancel in-progress runs for the same workflow and branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
add-job-summary: 'on-failure'
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Extract version information
id: extract_version
run: |
VERSION=$(grep 'version = "' build.gradle.kts | head -n 1 | awk -F'"' '{print $2}')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
COMMIT_SHA_SHORT=$(git rev-parse --short HEAD)
echo "COMMIT_SHA_SHORT=$COMMIT_SHA_SHORT" >> $GITHUB_ENV
echo "commit_sha_short=$COMMIT_SHA_SHORT" >> $GITHUB_OUTPUT
echo "Version: $VERSION (Commit: $COMMIT_SHA_SHORT)"
- name: Build with Gradle
run: ./gradlew build --no-daemon --stacktrace
- name: Run tests
run: ./gradlew test --no-daemon --stacktrace
- name: Generate Javadoc
run: ./gradlew javadoc --no-daemon
- name: Upload SmartSpawner JAR
uses: actions/upload-artifact@v4
with:
name: SmartSpawner-${{ steps.extract_version.outputs.version }}
path: core/build/libs/SmartSpawner-${{ steps.extract_version.outputs.version }}.jar
retention-days: 90
if-no-files-found: error
- name: Upload API JAR
uses: actions/upload-artifact@v4
with:
name: SmartSpawner-API-${{ steps.extract_version.outputs.version }}
path: api/build/libs/*.jar
retention-days: 90
if-no-files-found: warn
- name: Upload Javadoc
uses: actions/upload-artifact@v4
with:
name: SmartSpawner-Javadoc-${{ steps.extract_version.outputs.version }}
path: core/build/docs/javadoc/**
retention-days: 30
if-no-files-found: warn
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ steps.extract_version.outputs.commit_sha_short }}
path: |
**/build/reports/tests/**
**/build/test-results/**
retention-days: 7
if-no-files-found: ignore