diff --git a/.github/workflows/commitTest.yml b/.github/workflows/commitTest.yml index 34bc3b50..f769da76 100644 --- a/.github/workflows/commitTest.yml +++ b/.github/workflows/commitTest.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Set up PATH run: | echo "${ANDROID_HOME}/build-tools/34.0.0" >> $GITHUB_PATH diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..bd70fc4b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release Mod + +on: + release: + types: [published] + +permissions: + contents: write + +jobs: + buildJar: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v7 + - name: Set up PATH + run: | + echo "${ANDROID_HOME}/build-tools/34.0.0" >> $GITHUB_PATH + - name: Set up JDK 17 + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: 17 + - name: Build mod jar + run: | + chmod +x ./gradlew + ./gradlew deploy + - name: Upload release artifact + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release upload "${{ github.event.release.tag_name }}" \ + "build/libs/${{ github.event.repository.name }}.jar" \ + --clobber diff --git a/README.md b/README.md index 78a4f45d..88f00953 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,19 @@ # Mindustry Java Mod Template A Java Mindustry mod template that works on Android and PC. The Kotlin version of this mod can be seen [here](https://github.com/Anuken/MindustryKotlinModTemplate). +## Registering the mod with Mindustry Mod Browser + +The list of mods displayed in the Mod Browser is [created automatically](https://github.com/Anuken/MindustryMods). For your mod to be included, the following criteria need to be met: + +- Must have a valid `mod.json` / `mod.hjson` file in the root or `assets/` directory. +- Must have the `mindustry-mod` topic. Do **NOT** use the `mindustry-mod-v7` or `mindustry-mod-v8` topics, they are ignored! +- Must have a `minGameVersion` >= `136` in `mod.json`. +- Must have a release published, containing the compiled mod as an asset. This template ensures this asset is created automatically when a release is published, just creating and publishing a release is enough. + +### Opting Out + +If you would like to remove your mod from the public browser, add `hideBrowser: true` to your `mod.json` / `mod.hjson`. + ## Building for Desktop Testing 1. Install JDK **17**. diff --git a/build.gradle b/build.gradle index e1e43c32..55ec3a8f 100644 --- a/build.gradle +++ b/build.gradle @@ -77,6 +77,7 @@ jar{ from(projectDir){ include "mod.hjson" + include "icon.png" } from("assets/"){