ci: updated release ci/cd

Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
moonleay 2024-05-09 04:44:54 +02:00
parent e7d0e35bcf
commit a6c6bed5be
Signed by: moonleay
GPG key ID: 82667543CCD715FB
2 changed files with 14 additions and 2 deletions

View file

@ -30,10 +30,12 @@ plugins {
id("com.modrinth.minotaur") version "2.+"
}
val git_ref = System.getenv("GITHUB_REF_NAME") ?: "Not found"
val ver = if ((System.getenv("GITHUB_REF") ?: "local").startsWith("refs/tags/"))
System.getenv("GITHUB_REF_NAME") ?: "err" else System.getenv("GIT_SHA_SHORT") ?: "0.0.0"
val mavenVersion = "$ver-${project.ext["minecraft.version"] as String}"
val mavenVersion = ver
val modId: String by project
val modName: String by project
@ -211,11 +213,12 @@ publishing {
modrinth {
token.set(System.getenv("MODRINTH_TOKEN")) // Remember to have the MODRINTH_TOKEN environment variable set or else this will fail - just make sure it stays private!
projectId.set(modId) // This can be the project ID or the slug. Either will work!
versionNumber.set(System.getenv(mavenVersion)) // You don't need to set this manually. Will fail if Modrinth has this version already
versionNumber.set("$modName ${System.getenv(mavenVersion)} for $minecraftVersion") // You don't need to set this manually. Will fail if Modrinth has this version already
versionType.set("alpha") // This is the default -- can also be `beta` or `alpha`
uploadFile.set(tasks.remapJar) // With Loom, this MUST be set to `remapJar` instead of `jar`!
gameVersions.addAll(listOf(project.ext["minecraft.version"] as String)) // Must be an array, even with only one version
loaders.add("fabric") // Must also be an array - no need to specify this if you're using Loom or ForgeGradle
description = System.getenv("GIT_TAG") ?: "Could not get tag description"
dependencies { // A special DSL for creating dependencies
// scope.type
// The scope can be `required`, `optional`, `incompatible`, or `embedded`