CrazyAuctions/build.gradle.kts
2023-02-06 01:58:02 -05:00

54 lines
1.7 KiB
Plaintext

import task.WebhookExtension
import java.awt.Color
plugins {
id("crazyauctions.root-plugin")
}
val legacyUpdate = Color(255, 73, 110)
val releaseUpdate = Color(27, 217, 106)
val betaUpdate = Color(255, 163, 71)
val isBeta = settings.versions.projectBeta.get().toBoolean()
val projectVersion = settings.versions.projectVersion.get()
val projectName = settings.versions.projectName.get()
val projectExt = settings.versions.projectExtension.get()
val finalVersion = if (isBeta) "$projectVersion+Beta" else projectVersion
val projectNameLowerCase = projectName.toLowerCase()
val color = if (isBeta) betaUpdate else releaseUpdate
val repo = if (isBeta) "beta" else "releases"
webhook {
this.avatar("https://en.gravatar.com/avatar/${WebhookExtension.Gravatar().md5Hex("no-reply@ryderbelserion.com")}.jpeg")
this.username("Ryder Belserion")
this.content("New version of $projectName is ready! <@&929463441159254066>")
this.embeds {
this.embed {
this.color(color)
this.fields {
this.field(
"Version $finalVersion",
"Download Link: https://modrinth.com/$projectExt/$projectNameLowerCase/version/$finalVersion"
)
this.field(
"API Update",
"Version $finalVersion has been pushed to https://repo.crazycrew.us/#/$repo"
)
}
this.author(
projectName,
"https://modrinth.com/$projectExt/$projectNameLowerCase/versions",
"https://cdn-raw.modrinth.com/data/r3BBZyf3/4522ef0f83143c4803473d356160a3e877c2499c.png"
)
}
}
}