Skip to content

Commit b01fffd

Browse files
committed
add build.yml
1 parent d1cbf81 commit b01fffd

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
version: [
16+
"1.16", "1.16.1", "1.16.2", "1.16.3", "1.16.4", "1.16.5",
17+
"1.17", "1.17.1", "1.18", "1.18.1", "1.18.2",
18+
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4",
19+
"1.20", "1.20.1", "1.20.2", "1.20.4", "1.20.6",
20+
"1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4", "1.21.5", "1.21.8"
21+
]
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set up JDK 21
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '21'
30+
distribution: 'temurin'
31+
32+
- name: Grant execute permission for gradlew
33+
run: chmod +x gradlew
34+
35+
- name: Setup Gradle
36+
uses: gradle/actions/setup-gradle@v3
37+
38+
- name: Build with Gradle for MC ${{ matrix.version }}
39+
run: |
40+
./gradlew "Set active project to ${{ matrix.version }}"
41+
./gradlew build
42+
43+
- name: Upload artifacts
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: GreenTextMod-${{ matrix.version }}
47+
path: build/libs/*.jar
48+
49+
collect-artifacts:
50+
needs: build
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Download all artifacts
54+
uses: actions/download-artifact@v4
55+
with:
56+
path: artifacts
57+
58+
- name: Organize artifacts
59+
run: |
60+
mkdir -p all-versions
61+
find artifacts -name "*.jar" -exec cp {} all-versions/ \;
62+
63+
- name: Upload combined artifacts
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: GreenTextMod-all-versions
67+
path: all-versions/*.jar

0 commit comments

Comments
 (0)