ci: multi-version build matrix + multi-MC compat layer
- Parametrize build: -PmcVersion / -PapiCoordinate / -PjavaRelease / -PapiVersion; jar name includes mc version, plugin.yml api-version parametrized - Compat (reflection): sendBlockChanges / getClientViewDistance / getStructureManager (Paper 1.19.3+); particle()/potionEffect() name lookup for 1.21 renames (BLOCK_CRACK->BLOCK, REDSTONE->DUST, FIREWORKS_SPARK-> FIREWORK, JUMP->JUMP_BOOST, SLOW->SLOWNESS); drop CHERRY materials (1.20+) - Fix Java 17 'unconditional instanceof' in JoinCommandExecutor - capabilitiesResolution for org.bukkit:bukkit capability conflict on newer paper-api artifacts - .github/workflows/build.yml: matrix for 1.19.2/1.20.1 (Java 17), 1.21/1.21.11 (Java 21), 26.1.2/26.2 (Java 25) + quality gate - Verified locally: default + 1.19.2/1.20.1/1.21/1.21.11 build; 26.x deps resolve
This commit is contained in:
parent
3b5d3d97d5
commit
c0ca488b9d
13 changed files with 260 additions and 36 deletions
65
.github/workflows/build.yml
vendored
Normal file
65
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
# Build a shadowJar per Minecraft version against the matching Paper API.
|
||||
build-matrix:
|
||||
name: Build mc-${{ matrix.mc }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# 1.19.2 — Java 17
|
||||
- { mc: "1.19.2", coordinate: "io.papermc.paper:paper-api:1.19.2-R0.1-SNAPSHOT", java: 17, release: 17, api: "1.19" }
|
||||
# 1.20.1 — Java 17
|
||||
- { mc: "1.20.1", coordinate: "io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT", java: 17, release: 17, api: "1.20" }
|
||||
# 1.21 — Java 21
|
||||
- { mc: "1.21", coordinate: "io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT", java: 21, release: 21, api: "1.20" }
|
||||
# 1.21.11 — Java 21
|
||||
- { mc: "1.21.11", coordinate: "io.papermc.paper:paper-api:1.21.11-R0.1-SNAPSHOT", java: 21, release: 21, api: "1.21" }
|
||||
# 26.1.2 / 26.2 — Java 25 (new-style paper-api build artifacts; may need a
|
||||
# Gradle wrapper >= 8.14 if the daemon rejects Java 25 — bump if so).
|
||||
- { mc: "26.1.2", coordinate: "io.papermc.paper:paper-api:26.1.2.build.74-stable", java: 25, release: 25, api: "1.21" }
|
||||
- { mc: "26.2", coordinate: "io.papermc.paper:paper-api:26.2.build.97-stable", java: 25, release: 25, api: "1.21" }
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: ${{ matrix.java }}
|
||||
- name: Build jar (mc ${{ matrix.mc }})
|
||||
run: >
|
||||
./gradlew --no-daemon shadowJar
|
||||
-PmcVersion=${{ matrix.mc }}
|
||||
-PapiCoordinate='${{ matrix.coordinate }}'
|
||||
-PjavaRelease=${{ matrix.release }}
|
||||
-PapiVersion=${{ matrix.api }}
|
||||
- name: Upload jar
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: LoParkour-${{ matrix.mc }}
|
||||
path: build/libs/LoParkour-*.jar
|
||||
|
||||
# Full quality gate (checkstyle + PMD + tests) on the default build.
|
||||
quality:
|
||||
name: Quality gate (default 1.20.4)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
- name: Full build
|
||||
run: ./gradlew --no-daemon build
|
||||
- name: Upload default jar
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: LoParkour-default-1.20.4
|
||||
path: build/libs/LoParkour-*.jar
|
||||
Loading…
Add table
Add a link
Reference in a new issue