forked from LXYan2333/Fabric-Bedrock-Miner
-
Notifications
You must be signed in to change notification settings - Fork 15
51 lines (42 loc) · 1.27 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Mod Build
on: [push, pull_request, workflow_dispatch]
jobs:
build:
strategy:
matrix:
java: [21]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Java
uses: actions/setup-java@v3.6.0
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Make Gradle Wrapper Executable
run: chmod +x ./gradlew
- name: Setup Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
- name: Build with Gradle
run: ./gradlew build --info
continue-on-error: false # 根据需要决定是否添加此选项
- name: Find correct JAR
id: find-jar
run: |
output=$(ls build/libs/*.jar | grep -v '-dev\|-sources' | head -1)
echo "jarname=$output" >> $GITHUB_OUTPUT
- name: Update Build Artifacts
if: success()
uses: actions/upload-artifact@v3
with:
name: build-Mod
path: build/libs/