-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (53 loc) · 1.6 KB
/
build.yml
File metadata and controls
60 lines (53 loc) · 1.6 KB
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
name: step.build
on:
workflow_call:
inputs:
release:
type: boolean
required: false
default: false
target_subproject:
description: The subproject name of the specified Minecraft version to be built. Leave it empty to build all
type: string
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Cache gradle files
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
./.gradle/loom-cache
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/gradle.properties', '**/*.accesswidener') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Get subproject name to build
id: subproject_info
run: |
if [ "${{ inputs.target_subproject }}" != "" ]
then
echo "prefix=${{ inputs.target_subproject }}:" >> $GITHUB_OUTPUT
else
echo "prefix=" >> $GITHUB_OUTPUT
fi
- name: Build with Gradle
run: |
chmod +x gradlew
./gradlew ${{ steps.subproject_info.outputs.prefix }}build --no-daemon
env:
BUILD_ID: ${{ github.run_number }}
BUILD_RELEASE: ${{ inputs.release }}
- uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: versions/*/build/libs/