Skip to content

Commit 029885e

Browse files
committed
fix: neoforge gametests and publishing
(hopefully)
1 parent a13752b commit 029885e

File tree

62 files changed

+692
-625
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+692
-625
lines changed

.github/workflows/build.yml

-40
This file was deleted.

.github/workflows/codeql.yml

-41
This file was deleted.

.github/workflows/commit.yml

+216
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
name: Commit
2+
3+
on:
4+
push:
5+
branches: [ 'minecraft/*' ]
6+
7+
jobs:
8+
initialize:
9+
needs: validate-wrapper
10+
runs-on: ubuntu-22.04
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Validate Gradle wrapper
16+
uses: gradle/wrapper-validation-action@v1
17+
18+
- name: Setup JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: 17
22+
distribution: temurin
23+
24+
- name: Cache gradle dependencies
25+
uses: actions/cache@v4
26+
with:
27+
path: |
28+
~/.gradle/caches
29+
~/.gradle/wrapper
30+
.gradle/loom-cache
31+
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
32+
restore-keys: |
33+
${{ runner.os }}-gradle-${{github.ref_name}}-
34+
${{ runner.os }}-gradle-
35+
36+
- name: Initialize caches
37+
run: ./gradlew --no-daemon
38+
39+
license-headers:
40+
needs: initialize
41+
runs-on: ubuntu-22.04
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v4
45+
46+
- name: Setup JDK 17
47+
uses: actions/setup-java@v4
48+
with:
49+
java-version: 17
50+
distribution: temurin
51+
52+
- name: Restore gradle cache
53+
uses: actions/cache/restore@v4
54+
with:
55+
fail-on-cache-miss: true
56+
path: |
57+
~/.gradle/caches
58+
~/.gradle/wrapper
59+
.gradle/loom-cache
60+
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
61+
62+
- name: License headers
63+
run: ./gradlew checkLicenses --no-daemon
64+
65+
build:
66+
needs: initialize
67+
runs-on: ubuntu-22.04
68+
69+
steps:
70+
- name: Checkout repository
71+
uses: actions/checkout@v4
72+
73+
- name: Setup JDK 17
74+
uses: actions/setup-java@v4
75+
with:
76+
java-version: 17
77+
distribution: temurin
78+
79+
- name: Restore gradle cache
80+
uses: actions/cache/restore@v4
81+
with:
82+
fail-on-cache-miss: true
83+
path: |
84+
~/.gradle/caches
85+
~/.gradle/wrapper
86+
.gradle/loom-cache
87+
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
88+
89+
- name: Build
90+
run: ./gradlew assemble testClasses -x checkLicenses --no-daemon
91+
92+
- name: Cache build output
93+
uses: actions/cache/save@v4
94+
with:
95+
path: |
96+
.gradle/
97+
!.gradle/loom-cache
98+
build/
99+
key: ${{ runner.os }}-build-${{ github.sha }}
100+
101+
analysis:
102+
needs: initialize
103+
runs-on: ubuntu-22.04
104+
permissions:
105+
security-events: write
106+
107+
steps:
108+
- name: Checkout repository
109+
uses: actions/checkout@v4
110+
111+
- name: Setup JDK 17
112+
uses: actions/setup-java@v4
113+
with:
114+
java-version: 17
115+
distribution: temurin
116+
117+
- name: Restore gradle cache
118+
uses: actions/cache/restore@v4
119+
with:
120+
fail-on-cache-miss: true
121+
path: |
122+
~/.gradle/caches
123+
~/.gradle/wrapper
124+
.gradle/loom-cache
125+
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
126+
127+
- name: Initialize CodeQL
128+
uses: github/codeql-action/init@v3
129+
with:
130+
languages: java
131+
132+
- name: Build
133+
run: ./gradlew assemble testClasses -x checkLicenses --no-daemon
134+
135+
- name: Perform CodeQL Analysis
136+
uses: github/codeql-action/analyze@v3
137+
138+
test:
139+
needs: build
140+
runs-on: ubuntu-22.04
141+
142+
steps:
143+
- name: Checkout repository
144+
uses: actions/checkout@v4
145+
146+
- name: Setup JDK 17
147+
uses: actions/setup-java@v4
148+
with:
149+
java-version: 17
150+
distribution: temurin
151+
152+
- name: Restore gradle cache
153+
uses: actions/cache/restore@v4
154+
with:
155+
fail-on-cache-miss: true
156+
path: |
157+
~/.gradle/caches
158+
~/.gradle/wrapper
159+
.gradle/loom-cache
160+
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
161+
162+
- name: Restore cached build output
163+
uses: actions/cache/restore@v4
164+
with:
165+
fail-on-cache-miss: true
166+
path: |
167+
.gradle/
168+
!.gradle/loom-cache
169+
build/
170+
key: ${{ runner.os }}-build-${{ github.sha }}
171+
172+
- name: Test
173+
run: ./gradlew :fabric:runGametest :neoforge:runGameTestServer --no-daemon
174+
175+
publish:
176+
if: github.repository == 'TeamGalacticraft/DynamicDimensions'
177+
needs: [ test, license-headers, analysis ]
178+
runs-on: ubuntu-22.04
179+
180+
steps:
181+
- name: Checkout repository
182+
uses: actions/checkout@v4
183+
184+
- name: Setup JDK 17
185+
uses: actions/setup-java@v4
186+
with:
187+
java-version: 17
188+
distribution: temurin
189+
190+
- name: Restore gradle cache
191+
uses: actions/cache/restore@v4
192+
with:
193+
fail-on-cache-miss: true
194+
path: |
195+
~/.gradle/caches
196+
~/.gradle/wrapper
197+
.gradle/loom-cache
198+
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
199+
200+
- name: Restore cached build output
201+
uses: actions/cache/restore@v4
202+
with:
203+
fail-on-cache-miss: true
204+
path: |
205+
.gradle/
206+
!.gradle/loom-cache
207+
build/
208+
key: ${{ runner.os }}-build-${{ github.sha }}
209+
210+
- name: Publish
211+
run: ./gradlew publish -x test --no-daemon
212+
env:
213+
BUILD_NUMBER: ${{ github.run_number }}
214+
NEXUS_REPOSITORY_URL: ${{ secrets.NEXUS_RELEASE_URL }}
215+
NEXUS_USER: ${{ secrets.NEXUS_USER }}
216+
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

0 commit comments

Comments
 (0)