Files
2026-07-14 13:29:52 +08:00

60 lines
1.7 KiB
YAML

name: Build Pull Request
on:
pull_request:
branches:
- "**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Git Repository
uses: actions/checkout@v7
with:
submodules: recursive
- name: Set Up JDK
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 25
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
with:
add-job-summary: never
cache-read-only: true
- name: Configure Git User Details
run: |
git config --global user.email "ci-test@nanachiyo0721.moe"
git config --global user.name "Shiroha Test CI"
- name: Grant Execute Permission
run: chmod +x gradlew
- name: Apply Patches
run: ./gradlew applyAllPatches --stacktrace
- name: Build
run: ./gradlew createPaperclipJar --stacktrace
- name: Rename Artifact
run: |
prop() {
awk -F= -v key="$1" '$1 == key { val = $2; sub(/[[:space:]]*#.*$/, "", val); gsub(/^[[:space:]]+|[[:space:]]+$/, "", val); print val }' gradle.properties
}
jarName="shiroha-$(prop mcVersion).jar"
mv shiroha-server/build/libs/shiroha-paperclip-"$(prop version)"*.jar "$jarName" 2>/dev/null || \
mv shiroha-server/build/libs/*-paperclip-*.jar "$jarName" 2>/dev/null || true
echo "jar=$jarName" >> "$GITHUB_ENV"
- name: Upload Artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.jar || 'shiroha-pr' }}
path: ${{ env.jar || 'shiroha-server/build/libs/*-paperclip-*.jar' }}
if-no-files-found: warn