forked from headlesshq/headlessmc
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (79 loc) · 2.45 KB
/
Copy pathbuild-runtime-test.yml
File metadata and controls
87 lines (79 loc) · 2.45 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build mc-runtime-test
on:
workflow_call:
inputs:
branch:
description: 'The branch of mc-runtime-test to check out'
default: 'main'
required: false
type: string
dir:
description: 'The directory of mc-runtime-test to build in'
default: '1_21_5'
required: true
type: string
java:
description: 'The Java version to use'
default: 21
required: true
type: number
mc:
description: 'The Minecraft version to build for'
default: '1.21.5'
required: true
type: string
lex:
description: 'The LexForge version to build for'
default: '55.0.3'
required: true
type: string
neo:
description: 'The NeoForge version to build for'
default: '24-beta'
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
repository: headlesshq/mc-runtime-test
ref: ${{ inputs.branch }}
- name: Get commit SHA of checked-out repo
id: commit
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Cache build
id: cache
uses: actions/cache@v5
with:
path: ${{ inputs.dir }}/build
key: mcrt-${{ inputs.dir }}-${{ inputs.java }}-${{ inputs.mc }}-${{ steps.commit.outputs.sha }}
- if: steps.cache.outputs.cache-hit != 'true'
name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ inputs.java }}
- if: steps.cache.outputs.cache-hit != 'true'
name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
workflow-job-context: '{}' # FIXME: avoid this cache duplication workaround
- if: steps.cache.outputs.cache-hit != 'true'
name: Gradle build
run: >
./gradlew build --stacktrace
-Pminecraft_version=${{ inputs.mc }}
-Plexforge_version=${{ inputs.lex }}
-Pneoforge_version=${{ inputs.neo }}
working-directory: ${{ inputs.dir }}
- name: Display structure of built files
run: ls -R
# TODO: artifact for each modlauncher
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: mcrt-${{ inputs.mc }}
path: ${{ inputs.dir }}/build/libs/*.jar