9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-27 19:09:23 +00:00
Files
LeavesMC/.github/workflows/test.yml
MC_XiaoHei 43e2ac0845 Revert "chore: ignore ci temp"
This reverts commit 3d300dedd8.
2025-09-25 17:40:49 +08:00

47 lines
1.4 KiB
YAML

name: Leaves Test CI
on:
push:
branches-ignore: [ master ]
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get repository
uses: actions/checkout@v4
- name: Get JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "zulu"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
add-job-summary: never
cache-read-only: false
- name: Setup Git Config
run: |
git config --global user.email "ci-test@leavesmc.org"
git config --global user.name "LeavesMC Test CI"
- name: Apply Patches
run: ./gradlew applyAllPatches
- name: Create Leavesclip Jar
run: ./gradlew createMojmapLeavesclipJar
- name: Move Jar
run: |
prop() {
awk -F= -v key="$1" '$1 == key { val = $2; sub(/[[:space:]]*#.*$/, "", val); gsub(/^[[:space:]]+|[[:space:]]+$/, "", val); print val }' gradle.properties
}
jarName="leaves-$(prop mcVersion).jar"
mv leaves-server/build/libs/leaves-leavesclip-"$(prop version)"-mojmap.jar "$jarName"
echo "jar=$jarName" >> "$GITHUB_ENV"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.jar }}
path: ${{ env.jar }}