From 721e150ad930a8fa5fcb95de1869dbf2ab72e935 Mon Sep 17 00:00:00 2001 From: TexTrue <3140846162@qq.com> Date: Tue, 26 Sep 2023 21:10:20 +0800 Subject: [PATCH] auto upload, change modid to `rocknroller` --- .github/workflows/release.yml | 34 +++++++++++++++++ CHANGELOG.md | 2 + build.gradle | 37 +++++++++++++++++++ gradle.properties | 8 ++-- .../fi/dy/masa/itemscroller/Reference.java | 2 +- src/main/resources/META-INF/mods.toml | 14 +++---- 6 files changed, 86 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4828304 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Publish Release + +on: [workflow_dispatch] # Manual trigger + +permissions: + contents: write + +jobs: + Build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 20 + uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: 20 + - name: Cache + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + .gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }} + - uses: gradle/wrapper-validation-action@v1 + - run: | + chmod +x gradlew + ./gradlew build publishCurseForge publish modrinth --stacktrace -Porg.gradle.parallel.threads=4 + env: + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0fe63d2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +## Change +- change modid to `rocknroller` \ No newline at end of file diff --git a/build.gradle b/build.gradle index 7218d18..43b665d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,8 @@ plugins { id "dev.architectury.loom" version "1.2-SNAPSHOT" id "maven-publish" + id 'com.modrinth.minotaur' version '2.+' + id 'net.darkhax.curseforgegradle' version '1.+' } sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 @@ -63,6 +65,41 @@ jar { } } +modrinth { + token = System.getenv("MODRINTH_TOKEN") + + projectId = "${project.modrinth_id}" + versionNumber = "${project.version}" + versionType = "beta" + changelog = file("CHANGELOG.md").getText('UTF-8') + uploadFile = remapJar + additionalFiles = [sourcesJar] + gameVersions = ["1.19.3", "1.19.4"] + loaders = ["forge"] + dependencies { + required.project("mafglib") + } +} + +task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) { + apiToken = System.getenv("CURSEFORGE_TOKEN") + disableVersionDetection() + + def mainFile = upload(project.curseforge_id, remapJar) + mainFile.displayName = "${project.version}" + mainFile.releaseType = "beta" + mainFile.changelog = file("CHANGELOG.md") + mainFile.changelogType = "markdown" + mainFile.addModLoader("Forge") + mainFile.addJavaVersion("Java 17", "Java 18") + mainFile.addGameVersion("1.19.3", "1.19.4") + mainFile.addRequirement("mafglib") + + def sourcesFile = mainFile.withAdditionalFile(sourcesJar) + sourcesFile.changelog = file("CHANGELOG.md") + sourcesFile.changelogType = "markdown" +} + // configure the maven publication publishing { publications { diff --git a/gradle.properties b/gradle.properties index 6b57bb6..e84abde 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,11 +12,13 @@ loom.platform=forge yarn_mappings=1.19.4+build.2 # Mod Properties - mod_version=0.1.0 + mod_version=0.1.1 maven_group=org.thinkingstudio.rocknroller archives_base_name=RocknRoller - mod_id=itemscroller + mod_id=rocknroller mod_author=ThinkingStudio + modrinth_id=hYq29QmW + curseforge_id=916852 # Dependencies - malilib_version=0.1.8-mc1.19.4 \ No newline at end of file + malilib_version=0.1.9-mc1.19.4 \ No newline at end of file diff --git a/src/main/java/fi/dy/masa/itemscroller/Reference.java b/src/main/java/fi/dy/masa/itemscroller/Reference.java index 0d58d70..e26b8de 100644 --- a/src/main/java/fi/dy/masa/itemscroller/Reference.java +++ b/src/main/java/fi/dy/masa/itemscroller/Reference.java @@ -4,7 +4,7 @@ public class Reference { - public static final String MOD_ID = "itemscroller"; + public static final String MOD_ID = "rocknroller"; public static final String MOD_NAME = "Rock'n Roller"; public static final String MOD_VERSION = StringUtils.getModVersionString(MOD_ID); } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 486ec6e..e830e3c 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -3,7 +3,7 @@ loaderVersion = "[43,)" license = "LGPLv3" [[mods]] -modId = "itemscroller" +modId = "rocknroller" version = "${version}" displayName = "Rock'n Roller" displayURL="https://github.com/ThinkingStudios/ItemScroller-Forge" #optional @@ -16,23 +16,23 @@ Item Scroller unofficial forge port. Move items in inventory GUIs by scrolling the mouse wheel or dragging over slots ''' -[[dependencies.itemscroller]] +[[dependencies.rocknroller]] modId = "forge" mandatory = true versionRange = "[43,)" ordering = "NONE" side = "BOTH" -[[dependencies.itemscroller]] +[[dependencies.rocknroller]] modId = "minecraft" mandatory = true -versionRange = "[1.19.3,)" +versionRange = "[1.19.3,1.19.4]" ordering = "NONE" side = "BOTH" -[[dependencies.itemscroller]] -modId = "malilib" +[[dependencies.rocknroller]] +modId = "mafglib" mandatory = true -versionRange = "[0.1.5,)" +versionRange = "*" ordering = "NONE" side = "BOTH"