mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 02:20:01 +03:00
Builds on JDK 8 (required by Gradle 4.9 / ForgeGradle 2.3): runs `gradlew setup` then `gradlew build` and uploads the resulting jar as an artifact. Pre-creates build/distributions and build/libs so the cleanBuildDir() call in build.gradle does not NPE on a fresh checkout.
66 lines
1.9 KiB
YAML
66 lines
1.9 KiB
YAML
name: Build CatServer
|
|
|
|
on:
|
|
push:
|
|
branches: [ "1.12.2" ]
|
|
pull_request:
|
|
branches: [ "1.12.2" ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 8
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '8'
|
|
|
|
- name: Cache Gradle caches
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', 'gradle/wrapper/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Grant execute permission for gradlew
|
|
run: chmod +x gradlew
|
|
|
|
# build.gradle calls cleanBuildDir() at configuration time, which does
|
|
# new File("build/distributions").listFiles() — on a fresh checkout these
|
|
# directories do not exist yet and listFiles() returns null (-> NPE).
|
|
# Pre-create them so every gradle invocation configures cleanly.
|
|
- name: Pre-create build directories
|
|
run: mkdir -p build/distributions build/libs
|
|
|
|
- name: Setup workspace (decompile + apply patches)
|
|
run: ./gradlew setup --no-daemon --stacktrace
|
|
|
|
- name: Build universal jar
|
|
run: ./gradlew build --no-daemon --stacktrace
|
|
|
|
- name: List build output
|
|
if: always()
|
|
run: |
|
|
echo "----- build/distributions -----"
|
|
ls -lh build/distributions 2>/dev/null || true
|
|
echo "----- build/libs -----"
|
|
ls -lh build/libs 2>/dev/null || true
|
|
|
|
- name: Upload CatServer jar
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: CatServer-1.12.2-universal
|
|
path: |
|
|
build/distributions/*.jar
|
|
build/libs/*.jar
|
|
if-no-files-found: warn
|