-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (53 loc) · 1.79 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
52
53
54
55
56
57
58
59
60
61
62
name: build
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
permissions:
contents: write
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
17, # Current Java LTS & minimum supported by Minecraft
]
# and run on Linux
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: echo ref
run: echo ${{github.ref}}
- name: setup gradle with dependency graph
if: ${{github.ref == 'refs/heads/main' && github.event_name != 'pull_request'}}
uses: gradle/gradle-build-action@v2
# with:
# dependency-graph: 'generate-and-submit'
- name: setup gradle
if: ${{github.ref != 'refs/heads/main' || github.event_name == 'pull_request'}}
uses: gradle/gradle-build-action@v2
# with:
# dependency-graph: 'generate-and-upload'
- name: gradle clean build
run: ./gradlew clean build
# - name: Capture Fabric Artifacts
# if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
# uses: actions/upload-artifact@v3
# with:
# name: Fabric Artifacts
# path: fabric/build/libs
# - name: Capture Forge Artifacts
# if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
# uses: actions/upload-artifact@v3
# with:
# name: Forge Artifacts
# path: forge/build/libs