mirror of
https://github.com/Lucaslah/WeatherChanger.git
synced 2026-01-06 13:37:50 +00:00
Update build scripts
- add publish to modrinth script - add publish to curseforge script - update build and release ci - fix spelling in README.md Signed-off-by: Lucas Petrino <nsx1lucas@gmail.com>
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import io.github.themrmilchmann.gradle.publish.curseforge.ChangelogFormat
|
||||
import io.github.themrmilchmann.gradle.publish.curseforge.GameVersion
|
||||
import io.github.themrmilchmann.gradle.publish.curseforge.ReleaseType
|
||||
import net.fabricmc.loom.task.RemapJarTask
|
||||
|
||||
plugins {
|
||||
id("architectury-plugin") version "3.4-SNAPSHOT"
|
||||
id ("dev.architectury.loom") version "1.3-SNAPSHOT" apply false
|
||||
id("com.modrinth.minotaur") version "2.+"
|
||||
id("io.github.themrmilchmann.curseforge-publish") version "0.6.1"
|
||||
}
|
||||
|
||||
architectury {
|
||||
@@ -15,6 +22,10 @@ subprojects {
|
||||
"minecraft"("com.mojang:minecraft:${properties["minecraft_version"]}")
|
||||
"mappings"("net.fabricmc:yarn:${rootProject.properties["yarn_mappings"]}:v2")
|
||||
}
|
||||
|
||||
tasks.named("remapJar", RemapJarTask::class) {
|
||||
archiveBaseName.set(properties["archives_base_name"].toString() + archiveBaseName)
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@@ -22,7 +33,12 @@ allprojects {
|
||||
apply(plugin = "maven-publish")
|
||||
apply(plugin = "architectury-plugin")
|
||||
|
||||
version = properties["mod_version"].toString()
|
||||
version = if (System.getenv("CI_DEV_BUILD")?.toBoolean() == true) {
|
||||
System.getenv("BUILD_NUMBER") ?: properties["mod_version"].toString()
|
||||
} else {
|
||||
properties["mod_version"].toString()
|
||||
}
|
||||
|
||||
group = properties["maven_group"].toString()
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
@@ -33,4 +49,48 @@ allprojects {
|
||||
tasks.withType<Jar> {
|
||||
archiveBaseName.set(properties["archives_base_name"].toString())
|
||||
}
|
||||
}
|
||||
|
||||
modrinth {
|
||||
token.set(System.getenv("MODRINTH_TOKEN"))
|
||||
projectId.set("nhSHTGyl")
|
||||
versionNumber.set(properties["mod_version"].toString())
|
||||
versionType.set(properties["release_channel"].toString())
|
||||
uploadFile.set("build/libs/weather-changer-1.0.0.jar")
|
||||
gameVersions.addAll("1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4")
|
||||
|
||||
loaders.add("fabric")
|
||||
loaders.add("forge")
|
||||
|
||||
dependencies {
|
||||
required.project("fabric-api")
|
||||
}
|
||||
|
||||
syncBodyFrom = rootProject.file("README.md").readText()
|
||||
}
|
||||
|
||||
curseforge {
|
||||
publications {
|
||||
register("curseForge") {
|
||||
projectId = "682513"
|
||||
|
||||
gameVersions.add(GameVersion("minecraft-1-20", "1.20"))
|
||||
gameVersions.add(GameVersion("minecraft-1-20", "1.20.1"))
|
||||
gameVersions.add(GameVersion("minecraft-1-20", "1.20.2"))
|
||||
gameVersions.add(GameVersion("minecraft-1-20", "1.20.3"))
|
||||
gameVersions.add(GameVersion("minecraft-1-20", "1.20.4"))
|
||||
|
||||
artifacts.register("main") {
|
||||
displayName = "Weather Changer"
|
||||
// TODO: read from file
|
||||
releaseType = ReleaseType.BETA
|
||||
|
||||
changelog {
|
||||
// TODO: get from git diff
|
||||
format = ChangelogFormat.MARKDOWN
|
||||
from(file("CHANGELOG.md"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user