Skip to content

Commit 06ae29d

Browse files
Merge branch 'master' into v7.51
2 parents e74439e + f93006b commit 06ae29d

File tree

10 files changed

+86
-354
lines changed

10 files changed

+86
-354
lines changed
Lines changed: 18 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
@@ -80,22 +57,25 @@ jobs:
8057
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
8158
build-scan-terms-of-use-agree: "yes"
8259

83-
- name: Run migrateMappings task
60+
- name: Migrate mappings for main source set
8461
run: |
85-
./gradlew migrateMappings --mappings ${{ github.event.inputs.yarn_mappings }}
62+
./gradlew migrateMappings --mappings ${{ inputs.yarn_mappings }} --input "src/main/java" --output "src/main/java_"
63+
rm -rf ./src/main/java
64+
mv ./src/main/java_ ./src/main/java
8665
87-
- name: Replace src/main/java with remapped files
66+
- name: Migrate mappings for test source set
8867
run: |
89-
rm -rf ./src/main/java
90-
mv ./remappedSrc ./src/main/java
68+
./gradlew migrateMappings --mappings ${{ inputs.yarn_mappings }} --input "src/test/java" --output "src/test/java_"
69+
rm -rf ./src/test/java
70+
mv ./src/test/java_ ./src/test/java
9171
9272
- name: Update version constants
9373
run: |
9474
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 }}"
75+
"${{ inputs.mc_version }}" \
76+
"${{ inputs.yarn_mappings }}" \
77+
"${{ inputs.fabric_loader }}" \
78+
"${{ inputs.fapi_version }}"
9979
10080
# To fix any style issues that the migration scripts might cause
10181
- name: Run spotlessApply task
@@ -106,24 +86,15 @@ jobs:
10686
git config --global user.name "Wurst-Bot"
10787
git config --global user.email "[email protected]"
10888
git add .
109-
git commit -m "[Wurst-Bot] Update to ${{ github.event.inputs.mc_version }}"
89+
git commit -m "[Wurst-Bot] Update to ${{ inputs.mc_version }}"
11090
git push
11191
11292
- name: Trigger CI
113-
id: ci_dispatch
114-
uses: codex-/return-dispatch@v2
93+
uses: Wurst-Imperium/dispatch-and-wait@v1
11594
with:
11695
token: ${{ github.token }}
117-
owner: Wurst-Imperium
118-
repo: Wurst7
96+
owner: ${{ github.repository_owner }}
97+
repo: ${{ github.event.repository.name }}
11998
ref: ${{ github.ref }}
12099
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 }}
129100
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: 5 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:

.github/workflows/gradle.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,27 @@ 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:
@@ -35,8 +34,8 @@ jobs:
3534
IMGUR_CLIENT_ID: ${{ secrets.IMGUR_CLIENT_ID }}
3635
steps:
3736

38-
- name: Echo distinct ID ${{ github.event.inputs.distinct_id }}
39-
run: echo ${{ github.event.inputs.distinct_id }}
37+
- name: Echo distinct ID ${{ inputs.distinct_id }}
38+
run: echo ${{ inputs.distinct_id }}
4039

4140
- name: Checkout repository
4241
uses: actions/checkout@v5
Lines changed: 23 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Publish Multiple Releases
2-
run-name: Publish v${{ github.event.inputs.wurst_version }} build(s) from ${{ github.event.inputs.branches }}
2+
run-name: Publish v${{ inputs.wurst_version }} build(s) from ${{ inputs.branches }}
33

44
on:
55
workflow_dispatch:
@@ -64,108 +64,60 @@ jobs:
6464
branch: ${{ fromJson(needs.prepare.outputs.branches) }}
6565
# TODO: Maybe also verify that the wurst_version in each branch is as expected before publishing?
6666
steps:
67-
- name: Build publish inputs
68-
id: publish_inputs
69-
run: |
70-
JSON_STRING=$(cat << EOF
71-
{
72-
"close_milestone": "true",
73-
"upload_backups": "true",
74-
"publish_github": "true",
75-
"update_website": "true"
76-
}
77-
EOF
78-
)
79-
# Convert to single line and escape quotes
80-
echo "json=${JSON_STRING//$'\n'/}" >> "$GITHUB_OUTPUT"
8167
- name: Trigger publish workflow
82-
id: publish_dispatch
83-
uses: codex-/return-dispatch@v2
68+
uses: Wurst-Imperium/dispatch-and-wait@v1
8469
with:
8570
token: ${{ github.token }}
8671
owner: Wurst-Imperium
8772
repo: Wurst7
8873
ref: ${{ matrix.branch }}
8974
workflow: publish.yml
90-
workflow_inputs: ${{ steps.publish_inputs.outputs.json }}
91-
- name: Wait for publish workflow to finish (run ${{ steps.publish_dispatch.outputs.run_id }})
92-
uses: codex-/await-remote-run@v1
93-
with:
94-
token: ${{ github.token }}
95-
owner: Wurst-Imperium
96-
repo: Wurst7
97-
run_id: ${{ steps.publish_dispatch.outputs.run_id }}
98-
run_timeout_seconds: 600 # 10 minutes
75+
workflow_inputs: |
76+
{
77+
"close_milestone": "true",
78+
"upload_backups": "true",
79+
"publish_github": "true",
80+
"update_website": "true"
81+
}
82+
run_timeout_seconds: 1800 # 30 minutes
9983

10084
announce_update:
10185
runs-on: ubuntu-latest
10286
needs: [prepare, publish_each]
10387
if: ${{ !failure() && !cancelled() && inputs.announce_update }}
10488
steps:
105-
- name: Build announcement inputs
106-
id: announce_inputs
107-
run: |
108-
JSON_STRING=$(cat << EOF
109-
{
110-
"wurst_version": "${{ inputs.wurst_version }}",
111-
"dry_run": "${{ inputs.dry_run }}"
112-
}
113-
EOF
114-
)
115-
# Convert to single line and escape quotes
116-
echo "json=${JSON_STRING//$'\n'/}" >> "$GITHUB_OUTPUT"
11789
- name: Trigger announce workflow
118-
id: announce_dispatch
119-
uses: codex-/return-dispatch@v2
90+
uses: Wurst-Imperium/dispatch-and-wait@v1
12091
with:
12192
token: ${{ secrets.WURSTCLIENT_NET_PUBLISH_TOKEN }}
12293
owner: Wurst-Imperium
12394
repo: WurstClient.net
12495
ref: gh-pages
12596
workflow: announce_wurst_update.yml
126-
workflow_inputs: ${{ steps.announce_inputs.outputs.json }}
127-
- name: Wait for announce workflow to finish (run ${{ steps.announce_dispatch.outputs.run_id }})
128-
uses: codex-/await-remote-run@v1
129-
with:
130-
token: ${{ secrets.WURSTCLIENT_NET_PUBLISH_TOKEN }}
131-
owner: Wurst-Imperium
132-
repo: WurstClient.net
133-
run_id: ${{ steps.announce_dispatch.outputs.run_id }}
97+
workflow_inputs: |
98+
{
99+
"wurst_version": "${{ inputs.wurst_version }}",
100+
"dry_run": "${{ inputs.dry_run }}"
101+
}
134102
run_timeout_seconds: 600 # 10 minutes
135103

136104
announce_ports:
137105
runs-on: ubuntu-latest
138106
needs: [prepare, publish_each]
139107
if: ${{ !failure() && !cancelled() && inputs.announce_ports }}
140108
steps:
141-
- name: Build announcement inputs
142-
id: announce_inputs
143-
run: |
144-
JSON_STRING=$(cat << EOF
145-
{
146-
"wurst_version": "${{ inputs.wurst_version }}",
147-
"branches": "${{ inputs.branches }}",
148-
"dry_run": "${{ inputs.dry_run }}"
149-
}
150-
EOF
151-
)
152-
# Convert to single line and escape quotes
153-
echo "json=${JSON_STRING//$'\n'/}" >> "$GITHUB_OUTPUT"
154109
- name: Trigger announce workflow
155-
id: announce_dispatch
156-
uses: codex-/return-dispatch@v2
110+
uses: Wurst-Imperium/dispatch-and-wait@v1
157111
with:
158112
token: ${{ secrets.WURSTCLIENT_NET_PUBLISH_TOKEN }}
159113
owner: Wurst-Imperium
160114
repo: WurstClient.net
161115
ref: gh-pages
162116
workflow: announce_wurst_ports.yml
163-
workflow_inputs: ${{ steps.announce_inputs.outputs.json }}
164-
- name: Wait for announce workflow to finish (run ${{ steps.announce_dispatch.outputs.run_id }})
165-
uses: codex-/await-remote-run@v1
166-
with:
167-
token: ${{ secrets.WURSTCLIENT_NET_PUBLISH_TOKEN }}
168-
owner: Wurst-Imperium
169-
repo: WurstClient.net
170-
run_id: ${{ steps.announce_dispatch.outputs.run_id }}
117+
workflow_inputs: |
118+
{
119+
"wurst_version": "${{ inputs.wurst_version }}",
120+
"branches": "${{ inputs.branches }}",
121+
"dry_run": "${{ inputs.dry_run }}"
122+
}
171123
run_timeout_seconds: 600 # 10 minutes

0 commit comments

Comments
 (0)