Repository navigation
115 lines (99 loc) · 3.6 KB
/
Copy pathci.yml
File metadata and controls
115 lines (99 loc) · 3.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: CI
# Every pull request must build and pass on every Minecraft version before it can merge.
# `all-versions` requires every version job and the release-script checks, so it is the one check for a ruleset on main to require.
on:
pull_request:
push:
branches: [main]
jobs:
release-scripts:
name: Release script checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: python3 .github/scripts/test_release_changelog.py
- run: python3 .github/scripts/test_release_commit.py
- run: python3 .github/scripts/test_curseforge_versions.py
mc-26-3:
name: Minecraft 26.3 (Fabric + NeoForge)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: |
21
25
- uses: gradle/actions/setup-gradle@v6
# Git must hold the sources in their 26.3 state; Stonecutter rewrites them when another version is active.
- name: Check the sources are committed with 26.3 active
run: |
./gradlew "Reset active project"
git diff --exit-code
# Every version comment and replacement in stonecutter.gradle.kts has to turn back exactly, or switching the
# IDE to another version and back would rewrite code. The build itself never switches, so check it here.
- name: Check switching to 1.21.1 and back changes nothing
run: |
./gradlew "Set active project to 1.21.1"
./gradlew "Reset active project"
git diff --exit-code
- name: Check switching to 1.20.6 and back changes nothing
run: |
./gradlew "Set active project to 1.20.6"
./gradlew "Reset active project"
git diff --exit-code
- name: Unit tests, jars and server game test
run: ./gradlew :26.3:test :fabric:26.3:build :neoforge:26.3:build :neoforge:26.3:runGameTestServer
- name: Collect jars
run: ./gradlew collectJars
- uses: actions/upload-artifact@v7
with:
name: jars-26.3
path: build/libs/*/*.jar
mc-1-20-6:
name: Minecraft 1.20.6 (NeoForge)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: |
21
25
- uses: gradle/actions/setup-gradle@v6
- name: Unit tests and jar
run: ./gradlew :1.20.6:test :neoforge:1.20.6:build
- uses: actions/upload-artifact@v7
with:
name: jars-1.20.6
path: neoforge/versions/1.20.6/build/libs/primalpottery-neoforge-1.20.6-*.jar
mc-1-21-1:
name: Minecraft 1.21.1 (NeoForge)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: |
21
25
- uses: gradle/actions/setup-gradle@v6
- name: Unit tests and jar
run: ./gradlew :1.21.1:test :neoforge:1.21.1:build
- uses: actions/upload-artifact@v7
with:
name: jars-1.21.1
path: neoforge/versions/1.21.1/build/libs/primalpottery-neoforge-1.21.1-*.jar
all-versions:
name: all-versions
if: always()
needs: [mc-26-3, mc-1-20-6, mc-1-21-1, release-scripts]
runs-on: ubuntu-latest
steps:
- name: Every check passed
run: |
echo '${{ toJSON(needs) }}'
[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}" = "false" ]