You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-27Lines changed: 4 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ Before diving in, a good understanding of Java and Git is **highly recommended**
28
28
29
29
***`mod.json`:** This file contains your mod's metadata.
30
30
*`name`: The internal, unique ID for your mod (e.g., `my-awesome-mod`). This is critical and used by Gradle, generators, annotations, tools, and Mindustry itself. **It's highly recommended that your main Java package and related initial `template` folders (like `main/src/template`, `annotations/src/template/annotations`, `tools/src/template/tools`) are renamed to match this value (e.g., if `name` is `my-awesome-mod`, rename the `template` package to `myawesomemod`). This consistency greatly improves clarity, convenience, and compatibility with the template's systems.**
31
-
*`displayName`: The user-friendly name shown in Mindustry's mod browser (e.g., `My Awesome Mod`). This also influences the default names of your built JAR files via Gradle.
31
+
*`displayName`: The user-friendly name shown in Mindustry's mod browser (e.g., `My Awesome Mod`). This also influences the default names of your built JAR files via Gradle and the artifacts generated by GitHub Actions.
32
32
*`author`: Your name or your team's name.
33
33
*`description`: A brief description of your mod.
34
34
*`version`: Your mod's version (e.g., `1.0.0`).
@@ -45,29 +45,6 @@ Before diving in, a good understanding of Java and Git is **highly recommended**
45
45
*`annotations/src/template/annotations/...` to `annotations/src/myawesomemod/annotations/...`
46
46
*`tools/src/template/tools/...` to `tools/src/myawesomemod/tools/...`
47
47
* Update the `package` declarations within the Java files in these refactored directories.
48
-
***GitHub Actions CI (`.github/workflows/ci.yml`):**
49
-
* The Gradle build system will name your JAR files based on `modDisplayName` from `mod.json` (e.g., `MyAwesomeMod.jar`, `MyAwesomeModDesktop.jar`).
50
-
* However, the `ci.yml` file has **hardcoded paths and artifact names** that you **must update** to match your mod's `displayName`.
51
-
* Specifically, find these sections and update them:
52
-
* Under `steps:` for the `Build and Publish Jar` job:
53
-
```diff
54
-
- name: Upload built mod artifact as a GitHub Action artifact
55
-
# ...
56
-
with:
57
-
- name: Template (in a box)
58
-
- path: main/build/libs/Template.jar
59
-
+ name: YourModDisplayName (in a box) # Or any artifact name you prefer
60
-
+ path: main/build/libs/YourModDisplayName.jar # Match Gradle output
61
-
```
62
-
* And for the release:
63
-
```diff
64
-
- name: Upload built mod artifact into release
65
-
# ...
66
-
with:
67
-
- files: build/libs/Template.jar
68
-
+ files: build/libs/YourModDisplayName.jar # Match Gradle output for the cross-platform JAR
69
-
```
70
-
Replace `YourModDisplayName` with the value of `modDisplayName` from your `mod.json` (with spaces removed, e.g., if `displayName` is "My Awesome Mod", use `MyAwesomeMod`).
71
48
72
49
Here's an example of a properly configured mod base, assuming the mod's `displayName` is "My Awesome Mod" and `name` in `mod.json` is `my-awesome-mod`:
73
50
@@ -207,9 +184,9 @@ This produces a JAR compatible with both Android and PC (e.g., `MyAwesomeMod.jar
207
184
208
185
* **Using GitHub Actions (Recommended):**
209
186
* Push your changes to your GitHub repository.
210
-
* The CI workflow (defined in `.github/workflows/ci.yml` and **manually updated by you as described in step 4**) will automatically build both Desktop and Android JARs.
211
-
* You can download these from the "Artifacts" section of the completed workflow run. The cross-platform JAR artifact might be named something like `MyAwesomeMod (in a box).zip` (containing `MyAwesomeMod.jar`), depending on how you updated `ci.yml`.
212
-
* When you create a GitHub Release, the cross-platform JAR (e.g., `MyAwesomeMod.jar`) is automatically uploaded if you configured `ci.yml` correctly.
187
+
* The CI workflow (defined in `.github/workflows/ci.yml`) will automatically build both Desktop and Android JARs using names derived from your `mod.json`.
188
+
* You can download these from the "Artifacts" section of the completed workflow run. The cross-platform JAR artifact might be named something like `MyAwesomeMod (in a box).zip` (containing `MyAwesomeMod.jar`).
189
+
* When you create a GitHub Release, the cross-platform JAR (e.g., `MyAwesomeMod.jar`) is automatically uploaded.
0 commit comments