Skip to content

Commit 29abc1e

Browse files
Merge v7.50.2 into 1.21.4
2 parents 36cd443 + 729b5cd commit 29abc1e

File tree

18 files changed

+144
-408
lines changed

18 files changed

+144
-408
lines changed
Lines changed: 20 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
11
# Experimental workflow to automate updating to a new Minecraft snapshot.
2-
3-
# Currently this is very similar to the semi-automatic scripts I already use,
4-
# but moving them to GitHub Actions means I don't have to be around to start
5-
# them. This should allow for further automation in the future.
6-
7-
# TODO:
8-
# - Add more thorough automated testing where it runs the game, creates a test
9-
# world and takes screenshots, similar to what Fabric API does in their
10-
# GitHub Actions workflow.
11-
# - Set up a server to trigger this workflow when a new snapshot is out and
12-
# Fabric has updated to it. This might end up running twice per snapshot,
13-
# because there is no way to know ahead of time if the previous Fabric API
14-
# build still works or if we have to wait for a new build made specifically
15-
# for the new snapshot.
16-
# - Add a step to automatically release the new snapshot build if all tests
17-
# have passed. This will only ever run on small snapshots that don't break
18-
# anything, but should save a ton of time at the end of each snapshot cycle
19-
# when Mojang is spamming tiny pre-releases every day.
20-
21-
# In case it isn't obvious, these todos are very ambitious and might not end
22-
# up working as planned.
23-
242
name: Auto Snapshot Update
253

264
on:
@@ -39,7 +17,6 @@ on:
3917
description: "Fabric API version"
4018
required: true
4119
distinct_id:
42-
description: "Automatically set by the return-dispatch action (leave blank if running manually)"
4320
required: false
4421

4522
permissions:
@@ -53,8 +30,8 @@ jobs:
5330
runs-on: ubuntu-latest
5431
steps:
5532

56-
- name: Echo distinct ID ${{ github.event.inputs.distinct_id }}
57-
run: echo ${{ github.event.inputs.distinct_id }}
33+
- name: Echo distinct ID ${{ inputs.distinct_id }}
34+
run: echo ${{ inputs.distinct_id }}
5835

5936
- name: Checkout repository
6037
uses: actions/checkout@v5
@@ -79,23 +56,28 @@ jobs:
7956
build-scan-publish: true
8057
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
8158
build-scan-terms-of-use-agree: "yes"
59+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
60+
cache-read-only: ${{ github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/1.') }}
8261

83-
- name: Run migrateMappings task
62+
- name: Migrate mappings for main source set
8463
run: |
85-
./gradlew migrateMappings --mappings ${{ github.event.inputs.yarn_mappings }}
64+
./gradlew migrateMappings --mappings ${{ inputs.yarn_mappings }} --input "src/main/java" --output "src/main/java_"
65+
rm -rf ./src/main/java
66+
mv ./src/main/java_ ./src/main/java
8667
87-
- name: Replace src/main/java with remapped files
68+
- name: Migrate mappings for test source set
8869
run: |
89-
rm -rf ./src/main/java
90-
mv ./remappedSrc ./src/main/java
70+
./gradlew migrateMappings --mappings ${{ inputs.yarn_mappings }} --input "src/test/java" --output "src/test/java_"
71+
rm -rf ./src/test/java
72+
mv ./src/test/java_ ./src/test/java
9173
9274
- name: Update version constants
9375
run: |
9476
python scripts/update_version_constants.py \
95-
"${{ github.event.inputs.mc_version }}" \
96-
"${{ github.event.inputs.yarn_mappings }}" \
97-
"${{ github.event.inputs.fabric_loader }}" \
98-
"${{ github.event.inputs.fapi_version }}"
77+
"${{ inputs.mc_version }}" \
78+
"${{ inputs.yarn_mappings }}" \
79+
"${{ inputs.fabric_loader }}" \
80+
"${{ inputs.fapi_version }}"
9981
10082
# To fix any style issues that the migration scripts might cause
10183
- name: Run spotlessApply task
@@ -106,24 +88,15 @@ jobs:
10688
git config --global user.name "Wurst-Bot"
10789
git config --global user.email "[email protected]"
10890
git add .
109-
git commit -m "[Wurst-Bot] Update to ${{ github.event.inputs.mc_version }}"
91+
git commit -m "[Wurst-Bot] Update to ${{ inputs.mc_version }}"
11092
git push
11193
11294
- name: Trigger CI
113-
id: ci_dispatch
114-
uses: codex-/return-dispatch@v2
95+
uses: Wurst-Imperium/dispatch-and-wait@v1
11596
with:
11697
token: ${{ github.token }}
117-
owner: Wurst-Imperium
118-
repo: Wurst7
98+
owner: ${{ github.repository_owner }}
99+
repo: ${{ github.event.repository.name }}
119100
ref: ${{ github.ref }}
120101
workflow: gradle.yml
121-
122-
- name: Wait for CI to finish (run ${{ steps.ci_dispatch.outputs.run_id }})
123-
uses: codex-/await-remote-run@v1
124-
with:
125-
token: ${{ github.token }}
126-
owner: Wurst-Imperium
127-
repo: Wurst7
128-
run_id: ${{ steps.ci_dispatch.outputs.run_id }}
129102
run_timeout_seconds: 600 # 10 minutes

.github/workflows/check_translations.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ name: Check Translations
33
on:
44
push:
55
branches-ignore:
6-
- "dependabot/**"
6+
- "dependabot/**"
77
tags-ignore:
8-
- "**"
8+
- "**"
99
paths:
10-
- "src/main/resources/assets/wurst/translations/**.json"
11-
- "src/main/resources/intentionally_untranslated.json"
10+
- "src/main/resources/assets/wurst/translations/**.json"
11+
- "src/main/resources/intentionally_untranslated.json"
1212
pull_request:
1313
paths:
14-
- "src/main/resources/assets/wurst/translations/**.json"
15-
- "src/main/resources/intentionally_untranslated.json"
14+
- "src/main/resources/assets/wurst/translations/**.json"
15+
- "src/main/resources/intentionally_untranslated.json"
1616
workflow_dispatch:
1717

1818
jobs:
@@ -23,10 +23,8 @@ jobs:
2323
- name: Checkout repository
2424
uses: actions/checkout@v5
2525

26-
- name: Set up Python 3.12
27-
uses: actions/setup-python@v6
26+
- name: Check translations
27+
uses: Wurst-Imperium/check-translations@v1
2828
with:
29-
python-version: "3.12"
30-
31-
- name: Run check_translations.py
32-
run: python scripts/check_translations.py
29+
lang-dir: "src/main/resources/assets/wurst/translations"
30+
wurst-mode: true

.github/workflows/dependency_graph.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name: Update Gradle Dependency Graph
33
on:
44
push:
55
branches:
6-
# Submitting dependency graph reports on non-default branches does nothing
7-
- "master"
6+
# Submitting dependency graph reports on non-default branches does nothing
7+
- "master"
88
tags-ignore:
9-
- "**"
9+
- "**"
1010
paths:
11-
- "gradle**"
12-
- "*.gradle"
11+
- "gradle**"
12+
- "*.gradle"
1313
workflow_dispatch:
1414

1515
permissions:
@@ -39,3 +39,4 @@ jobs:
3939
build-scan-publish: true
4040
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
4141
build-scan-terms-of-use-agree: "yes"
42+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}

.github/workflows/gradle.yml

Lines changed: 36 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,36 @@ name: Java CI with Gradle
33
on:
44
push:
55
branches-ignore:
6-
- "dependabot/**"
6+
- "dependabot/**"
77
tags-ignore:
8-
- "**"
8+
- "**"
99
paths:
10-
- "**.java"
11-
- "**.json"
12-
- "**.yml"
13-
- "gradle**"
14-
- "*.gradle"
15-
- "*.accesswidener"
10+
- "**.java"
11+
- "**.json"
12+
- "**.yml"
13+
- "gradle**"
14+
- "*.gradle"
15+
- "*.accesswidener"
1616
pull_request:
1717
paths:
18-
- "**.java"
19-
- "**.json"
20-
- "**.yml"
21-
- "gradle**"
22-
- "*.gradle"
23-
- "*.accesswidener"
18+
- "**.java"
19+
- "**.json"
20+
- "**.yml"
21+
- "gradle**"
22+
- "*.gradle"
23+
- "*.accesswidener"
2424
workflow_dispatch:
2525
inputs:
2626
distinct_id:
27-
description: "Automatically set by the return-dispatch action (leave blank if running manually)"
2827
required: false
2928

3029
jobs:
3130
build:
3231
runs-on: ubuntu-latest
33-
env:
34-
VIRUSTOTAL_API_KEY: ${{ secrets.VIRUSTOTAL_API_KEY }}
35-
IMGUR_CLIENT_ID: ${{ secrets.IMGUR_CLIENT_ID }}
3632
steps:
3733

38-
- name: Echo distinct ID ${{ github.event.inputs.distinct_id }}
39-
run: echo ${{ github.event.inputs.distinct_id }}
34+
- name: Echo distinct ID ${{ inputs.distinct_id }}
35+
run: echo ${{ inputs.distinct_id }}
4036

4137
- name: Checkout repository
4238
uses: actions/checkout@v5
@@ -56,30 +52,16 @@ jobs:
5652
build-scan-publish: true
5753
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
5854
build-scan-terms-of-use-agree: "yes"
59-
60-
- name: Compile Java code
61-
run: ./gradlew remapJar --stacktrace --warning-mode=fail
62-
63-
- name: Validate JSON files
64-
run: ./gradlew spotlessJsonCheck || (echo "::error::JSON validation failed! Run './gradlew spotlessApply' to fix style issues, or check the full error message for syntax errors." && exit 1)
65-
66-
- name: Validate Java code style
67-
run: ./gradlew spotlessJavaCheck || (echo "::error::Java code style validation failed! To fix, run 'Clean Up' and then 'Format' in Eclipse, or './gradlew spotlessApply' in the terminal." && exit 1)
68-
69-
- name: Validate license headers
70-
run: ./gradlew spotlessLicenseHeaderCheck || (echo "::error::License headers are missing or malformed in some files! Run './gradlew spotlessApply' to fix this, or check the full error message for details." && exit 1)
71-
72-
- name: Run unit tests
73-
run: ./gradlew test --stacktrace --warning-mode=fail
74-
75-
- name: Validate access widener
76-
run: ./gradlew validateAccessWidener --stacktrace --warning-mode=fail
55+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
56+
cache-read-only: ${{ github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/1.') }}
7757

7858
- name: Build
7959
run: ./gradlew build --stacktrace --warning-mode=fail
8060

8161
- name: Upload to VirusTotal for analysis
8262
id: virustotal
63+
env:
64+
VIRUSTOTAL_API_KEY: ${{ secrets.VIRUSTOTAL_API_KEY }}
8365
if: ${{ env.VIRUSTOTAL_API_KEY }}
8466
uses: crazy-max/ghaction-virustotal@v4
8567
with:
@@ -91,7 +73,7 @@ jobs:
9173
continue-on-error: true
9274

9375
- name: Add VirusTotal links to build summary
94-
if: ${{ env.VIRUSTOTAL_API_KEY && steps.virustotal.outputs.analysis }}
76+
if: ${{ steps.virustotal.outputs.analysis }}
9577
run: |
9678
echo "<details open>" >> $GITHUB_STEP_SUMMARY
9779
echo "<summary>🛡️ VirusTotal Scans</summary>" >> $GITHUB_STEP_SUMMARY
@@ -106,20 +88,27 @@ jobs:
10688
echo "</details>" >> $GITHUB_STEP_SUMMARY
10789
10890
- name: Run the mod and take screenshots
109-
uses: GabrielBB/[email protected]
110-
with:
111-
run: ./gradlew runEndToEndTest --stacktrace --warning-mode=fail
91+
# TODO: Migrate to Fabric Client Gametest API so this can run with configuration cache enabled
92+
run: xvfb-run --auto-servernum ./gradlew runEndToEndTest --stacktrace --warning-mode=fail --no-configuration-cache
11293

113-
# Needed because the screenshot gallery won't be created on pull requests.
114-
# Also useful if Imgur uploads fail.
115-
- name: Upload Test Screenshots.zip artifact
94+
- name: Upload screenshots.zip artifact
11695
uses: actions/upload-artifact@v4
117-
if: always()
96+
if: ${{ success() || failure() }}
11897
with:
119-
name: Test Screenshots
98+
name: screenshots
12099
path: run/screenshots
100+
compression-level: 0
101+
102+
- name: Upload crash-reports.zip artifact
103+
uses: actions/upload-artifact@v4
104+
if: ${{ failure() }}
105+
with:
106+
name: crash-reports
107+
path: run/crash-reports
121108

122109
- name: Create test screenshot gallery
110+
env:
111+
IMGUR_CLIENT_ID: ${{ secrets.IMGUR_CLIENT_ID }}
123112
if: ${{ env.IMGUR_CLIENT_ID && (success() || failure()) }}
124113
# Imgur uploads randomly fail sometimes, probably because of the low rate limit.
125114
# TODO: Find a better place to upload the screenshots.

0 commit comments

Comments
 (0)