Skip to content

Commit

Permalink
replace minotaur and darkar cursegradle with mod-publish-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
SrRapero720 committed Dec 28, 2024
1 parent bff5656 commit 9678e89
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 56 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,8 @@ jobs:
- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Release on CurseForge
run: ./gradlew curseforge
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}

- name: Release on Modrinth
run: ./gradlew modrinth
- name: Release on CurseForge and Modrinth
run: ./gradlew publishMods
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
78 changes: 34 additions & 44 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import net.darkhax.curseforgegradle.TaskPublishCurseForge

plugins {
id 'java'
id 'idea'
id 'com.github.johnrengelman.shadow' version '8.1.+'
id 'com.google.osdetector' version '1.7.+'
id 'com.modrinth.minotaur' version '2.+'
id 'net.darkhax.curseforgegradle' version '1.1.+'
id "me.modmuss50.mod-publish-plugin" version "0.8.3"
}

def MT_TOKEN = System.getenv("MODRINTH_TOKEN")
Expand Down Expand Up @@ -132,47 +129,40 @@ jar {
finalizedBy shadowJar
}

tasks.register('releaseJar', GradleBuild) {
dependsOn build

group 'publishing'
description 'Uploads new version to modrinth and curseforge.'
setTasks(['curseforge', 'modrinth'])
}

tasks.register('curseforge', TaskPublishCurseForge) {
disableVersionDetection()
apiToken = CF_TOKEN

// MAIN FILE
def mainFile = upload(curseforgeid, shadowJar)
mainFile.displayName = "WM/$version"
mainFile.changelog = getChangelogText()
mainFile.changelogType = "markdown"
mainFile.releaseType = versiontype
mainFile.addModLoader("Forge", "NeoForge", "Fabric")
mainFile.addJavaVersion("Java 21", "Java 17", "Java 11", "Java 8")
mainFile.addGameVersion("1.16.5", "1.18.2", "1.19.2", "1.20.1", "1.21.1", "client")
mainFile.addIncompatibility("fancyvideo-api")
def sourcesFile = mainFile.withAdditionalFile(sourcesJar)
sourcesFile.displayName = "WM/$version-sources"
sourcesFile.changelog = ""
sourcesFile.releaseType = versiontype
}

modrinth {
token = MT_TOKEN
projectId = modrinthid
versionName = "$brandname/$version"
publishMods {
file = shadowJar.archiveFile
changelog = getChangelogText()
versionNumber = version.toString()
versionType = versiontype
uploadFile = shadowJar
loaders = [ "forge", "neoforge", "fabric" ]
gameVersions = [ "1.16.5", "1.18.2", "1.19.2", "1.20.1", "1.21.1" ]
additionalFiles = [ sourcesJar ]

group = 'publishing'
type = STABLE
displayName = "WM/${project.properties.version}"
modLoaders.add("forge")
modLoaders.add("neoforge")
modLoaders.add("fabric")

additionalFiles.from(sourcesJar.archiveFile)
maxRetries = 2

dryRun = false

curseforge {
accessToken = CF_TOKEN
projectId = curseforgeid
minecraftVersions.addAll("1.16.5", "1.18.2", "1.19.2", "1.20.1", "1.21.1")
javaVersions.addAll(JavaVersion.VERSION_21, JavaVersion.VERSION_17, JavaVersion.VERSION_11, JavaVersion.VERSION_1_8)
clientRequired = true
serverRequired = false
projectSlug = id
incompatible("fancyvideo-api")
additionalFile(sourcesJar) {
name = "WM-sources/${project.properties.version}"
}
}

modrinth {
accessToken = MT_TOKEN
projectId = modrinthid
minecraftVersions.addAll("1.16.5", "1.18.2", "1.19.2", "1.20.1", "1.21.1")
incompatible("vlcvideoapi-pol")
}
}

def getChangelogText() {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ group=me.srrapero720
version=2.1.9
versiontype=release
github=WaterMediaTeam/watermedia
modrinthid=watermedia
modrinthid=G922NeHS
curseforgeid=869524

#########################
Expand Down
4 changes: 1 addition & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ pluginManagement {
mavenCentral()
gradlePluginPortal()
}
}

include 'lib-vlcj'
}

0 comments on commit 9678e89

Please sign in to comment.