Skip to content

Commit 2e1d286

Browse files
authored
Update workflow configs (#88)
1 parent 91b0ac5 commit 2e1d286

File tree

5 files changed

+116
-93
lines changed

5 files changed

+116
-93
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
version: 2
22
updates:
33
- package-ecosystem: "gradle"
4+
cooldown:
5+
default-days: 7
46
directory: "/"
57
schedule:
68
interval: "monthly"
79
- package-ecosystem: "github-actions"
10+
cooldown:
11+
default-days: 7
812
directory: "/"
913
schedule:
1014
interval: "monthly"

.github/workflows/build.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/check.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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 }}

.github/workflows/main.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test
2+
on: [push, pull_request]
3+
permissions:
4+
contents: read
5+
6+
jobs:
7+
test:
8+
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
9+
runs-on: ubuntu-24.04
10+
timeout-minutes: 30
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
14+
with:
15+
persist-credentials: false
16+
- name: Set up Gradle
17+
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # 5.0.0
18+
- name: Set up JDK 25
19+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # 5.0.0
20+
with:
21+
distribution: 'temurin'
22+
java-version: 25
23+
check-latest: true
24+
- name: Build and test with Gradle
25+
run: ./gradlew test

0 commit comments

Comments
 (0)