1+ name : Check for new Minecraft snapshot
2+
3+ on :
4+ schedule :
5+ - cron : ' 10 * * * *'
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : write
10+ pull-requests : write
11+
12+ jobs :
13+ check :
14+ runs-on : ubuntu-24.04
15+ steps :
16+ - name : Checkout Repository
17+ uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
18+ with :
19+ persist-credentials : false
20+ fetch-depth : 0
21+
22+ - name : Set up Python
23+ uses : actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
24+ with :
25+ python-version : ' 3.14.x'
26+
27+ - name : Check for snapshot
28+ run : pip install -r requirements.txt && python download_server.py
29+
30+ - name : Set up Gradle
31+ uses : gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # 5.0.0
32+
33+ - name : Set up JDK 25
34+ uses : actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # 5.0.0
35+ with :
36+ distribution : ' temurin'
37+ java-version : 25
38+ check-latest : true
39+
40+ # Wooyeah
41+ - name : Read last snapshot
42+ id : last_snapshot
43+ uses : juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # 1.1.7
44+ with :
45+ path : ./last_snapshot.txt
46+ - name : Read last release
47+ id : last_release
48+ uses : juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # 1.1.7
49+ with :
50+ path : ./last_release.txt
51+ - name : Read next release
52+ id : next_release
53+ uses : juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # 1.1.7
54+ with :
55+ path : ./next_release.txt
56+
57+ - name : Compile MappingsGenerator jar
58+ run : ./gradlew build && mv build/libs/MappingsGenerator-*.jar ./MappingsGenerator.jar
59+ - name : Run MappingsGenerator
60+ run : java -jar MappingsGenerator.jar server.jar ${STEPS_NEXT_RELEASE_OUTPUTS_CONTENT}
61+ env :
62+ STEPS_NEXT_RELEASE_OUTPUTS_CONTENT : ${{ steps.next_release.outputs.content }}
63+ - name : Pack mappings
64+ run : java -cp MappingsGenerator.jar com.viaversion.mappingsgenerator.MappingsOptimizer ${STEPS_LAST_RELEASE_OUTPUTS_CONTENT} ${STEPS_NEXT_RELEASE_OUTPUTS_CONTENT} --generateDiffStubs
65+ env :
66+ STEPS_LAST_RELEASE_OUTPUTS_CONTENT : ${{ steps.last_release.outputs.content }}
67+ STEPS_NEXT_RELEASE_OUTPUTS_CONTENT : ${{ steps.next_release.outputs.content }}
68+ - name : Pack backwards mappings
69+ run : java -cp MappingsGenerator.jar com.viaversion.mappingsgenerator.MappingsOptimizer ${STEPS_NEXT_RELEASE_OUTPUTS_CONTENT} ${STEPS_LAST_RELEASE_OUTPUTS_CONTENT} --generateDiffStubs
70+ env :
71+ STEPS_NEXT_RELEASE_OUTPUTS_CONTENT : ${{ steps.next_release.outputs.content }}
72+ STEPS_LAST_RELEASE_OUTPUTS_CONTENT : ${{ steps.last_release.outputs.content }}
73+
74+ - name : Commit changes
75+ run : |
76+ git config --local user.email "[email protected] " 77+ git config --local user.name "automation"
78+ git add .
79+ git commit -am "Update: ${STEPS_LAST_SNAPSHOT_OUTPUTS_CONTENT}"
80+ env :
81+ STEPS_LAST_SNAPSHOT_OUTPUTS_CONTENT : ${{ steps.last_snapshot.outputs.content }}
82+
83+ - name : Push changes
84+ uses : ad-m/github-push-action@77c5b412c50b723d2a4fbc6d71fb5723bcd439aa # 1.0.0
85+ with :
86+ github_token : ${{ secrets.TOKEN }}
87+ branch : ${{ github.ref }}
0 commit comments