generated from isXander/FabricModTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 66
78 lines (68 loc) · 2.01 KB
/
build.yml
File metadata and controls
78 lines (68 loc) · 2.01 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
name: Gradle CI (new)
on:
push:
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
- '.editorconfig'
- 'changelog.md'
- 'docs'
pull_request:
jobs:
generate-build-matrix:
runs-on: ubuntu-latest
name: Generate build matrix
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get potential versions
id: generate-matrix
run: |
MATRIX=$(jq -c '{include: (.branches[""] | map({target: ., experimental: (test("exp"))}))}' ./versions/versions.json)
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
build:
needs: generate-build-matrix
runs-on: ubuntu-latest
name: Build with gradle
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-build-matrix.outputs.matrix) }}
continue-on-error: ${{ matrix.experimental == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 25
distribution: temurin
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Overwrite current version
run: printf "%s" "${{ matrix.target }}" | cut -d':' -f1 | tr -d '\n' > ./versions/current
- name: Build ${{ matrix.target }}
run: |
./gradlew "Refresh active project"
./gradlew buildAndCollectActive --stacktrace
env:
CI_SINGLE_BUILD: ${{ matrix.target }}
- name: Sanitize artifact name
run: |
raw="${{ matrix.target }}"
clean="${raw%%:*}"
echo "ARTIFACT_NAME=$clean" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
path: build/finalJars/*.jar
name: ${{ env.ARTIFACT_NAME }}
# run:
# needs: build
# runs-on: ubuntu-latest
# name: Run Minecraft
#
# strategy:
# matrix:
# target: ${{ fromJson(needs.retrieve-targets.outputs.targets) }}