diff --git a/.github/workflows/gradle_build.yml b/.github/workflows/gradle_build.yml index 359b551..328fe97 100755 --- a/.github/workflows/gradle_build.yml +++ b/.github/workflows/gradle_build.yml @@ -2,17 +2,13 @@ name: Gradle Build on: push: - branches: - - '*' pull_request: - branches: - - '*' jobs: build: strategy: matrix: - java: [ 17, 20 ] + java: [ 17, 21 ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e99b71f..1703eaf 100755 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,13 +26,6 @@ jobs: MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} - - name: Synchronize Mod description - uses: gradle/gradle-build-action@v2 - with: - arguments: modrinthSyncBody --stacktrace - env: - MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - - uses: actions/upload-artifact@v3 with: name: Artifacts diff --git a/HEADER b/HEADER index d591413..1f5d252 100755 --- a/HEADER +++ b/HEADER @@ -1,4 +1,4 @@ -Copyright (c) ${YEAR} LambdAurora +Copyright (c) ${CREATION_YEAR} LambdAurora This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -13,5 +13,4 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . -;;year_selection: file -;;year_display: creation_only +#year_selection file diff --git a/build.gradle b/build.gradle index 40a341f..c72e27a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,18 +1,18 @@ plugins { - id 'fabric-loom' version '1.2.+' - id 'io.github.juuxel.loom-vineflower' version '1.11.+' - id 'org.quiltmc.gradle.licenser' version '2.0.+' + id 'fabric-loom' version '1.4.+' + id 'dev.yumi.gradle.licenser' version '1.0.+' id 'java-library' id 'maven-publish' id 'com.modrinth.minotaur' version '2.+' - id 'com.matthewprenger.cursegradle' version '1.4.+' + id 'net.darkhax.curseforgegradle' version '1.1.+' } import com.modrinth.minotaur.dependencies.ModDependency +import net.darkhax.curseforgegradle.TaskPublishCurseForge group = project.maven_group version = "${project.mod_version}+${project.minecraft_version}" -archivesBaseName = project.archives_base_name +base.archivesName = project.archives_base_name // This field defines the Java version your mod target. def targetJavaVersion = 17 @@ -123,7 +123,6 @@ jar { license { rule file('HEADER') - include '**/*.java' } modrinth { @@ -151,57 +150,36 @@ modrinth { } tasks.modrinth.dependsOn(tasks.modrinthSyncBody) -curseforge { +tasks.register('curseforge', TaskPublishCurseForge) { + setGroup("publishing") + if (System.getenv("CURSEFORGE_TOKEN")) { - apiKey = System.getenv("CURSEFORGE_TOKEN") + apiToken = System.getenv("CURSEFORGE_TOKEN") + } else { + setEnabled(false) + return } - project { - id = project.curseforge_id - releaseType = this.getVersionType() - addGameVersion project.minecraft_version - addGameVersion "Fabric" - addGameVersion "Quilt" - addGameVersion "Java 17" - addGameVersion "Java 18" - - // Changelog fetching - def changelogContent = fetchChangelog() - - if (changelogContent) { - changelogType = "markdown" - changelog = "Changelog:\n\n${changelogContent}" - } else { - afterEvaluate { - uploadTask.setEnabled(false) - } - } - - mainArtifact(remapJar) { - displayName = "Lovely Snails ${project.mod_version} (${project.minecraft_version})" - - relations { - requiredDependency "fabric-api" - optionalDependency "modmenu" - } - } + // Changelog fetching + def changelogContent = fetchChangelog() - afterEvaluate { - uploadTask.setGroup("publishing") - uploadTask.dependsOn("remapJar") - } + if (changelogContent) { + changelogContent = "Changelog:\n\n${changelogContent}" + } else { + setEnabled(false) + return } -} -tasks.curseforge.setGroup("publishing") -// configure the maven publication -publishing { - publications { - mavenJava(MavenPublication) { - from(components.java) - } - } + def mainFile = upload(project.curseforge_id, tasks.remapJar) + mainFile.releaseType = this.getVersionType() + mainFile.addGameVersion(project.minecraft_version) + mainFile.addModLoader("Fabric", "Quilt") + mainFile.addJavaVersion("Java 17", "Java 18") - repositories { - } + mainFile.displayName = "Lovely Snails ${project.mod_version} (${project.minecraft_version})" + mainFile.addRequirement("fabric-api") + mainFile.addOptional("modmenu") + + mainFile.changelogType = "markdown" + mainFile.changelog = changelogContent } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d..744c64d 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle deleted file mode 100755 index 043e999..0000000 --- a/settings.gradle +++ /dev/null @@ -1,13 +0,0 @@ -pluginManagement { - repositories { - maven { - name 'Quilt' - url 'https://maven.quiltmc.org/repository/release' - } - maven { - name 'Fabric' - url 'https://maven.fabricmc.net/' - } - gradlePluginPortal() - } -} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100755 index 0000000..83f740d --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,11 @@ +pluginManagement { + repositories { + maven { + name = "Fabric" + url = uri("https://maven.fabricmc.net/") + } + gradlePluginPortal() + } +} + +rootProject.name = "Lovely Snails"