forked from UltimateBoomer/mc-smoothboot
-
Notifications
You must be signed in to change notification settings - Fork 7
70 lines (57 loc) · 1.63 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
63
64
65
66
67
68
69
70
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.
name: CI
on:
push:
branches: [main]
paths:
- "src/**"
- "gradle/**"
- "**.gradle"
- "gradlew*"
- "gradle.properties"
tags-ignore:
- "**"
pull_request:
paths:
- "src/**"
- "gradle/**"
- "**.gradle"
- "gradlew*"
- "gradle.properties"
workflow_dispatch:
workflow_call:
jobs:
build:
name: Build
strategy:
matrix:
java:
- 21 # Current Java LTS & minimum supported by Minecraft
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ matrix.java }}
cache: "gradle"
- name: Make Gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: Build
run: ./gradlew build
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v4
with:
name: jars
path: build/libs/
if-no-files-found: error