diff --git a/build.gradle.kts b/build.gradle.kts index f902bb3f..462fea68 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,4 @@ +import com.lordcodes.turtle.shellRun import task.WebhookExtension import java.awt.Color @@ -18,6 +19,10 @@ val url = if (beta) "https://ci.crazycrew.us/job/${rootProject.name}/" else "htt val download = if (beta) "https://ci.crazycrew.us/job/${rootProject.name}/" else "https://modrinth.com/$extension/${rootProject.name.lowercase()}/version/${rootProject.version}" val msg = if (beta) "New version of ${rootProject.name} is ready!" else "New version of ${rootProject.name} is ready! <@&929463450214735912>" +val hash = shellRun("git", listOf("rev-parse", "--short", "HEAD")) + +rootProject.version = if (beta) hash else "1.4.20.4" + webhook { this.avatar("https://en.gravatar.com/avatar/${WebhookExtension.Gravatar().md5Hex("no-reply@ryderbelserion.com")}.jpeg") diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 86c425a9..20fb3666 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -20,4 +20,6 @@ dependencies { implementation("io.ktor:ktor-serialization-gson:$ktor") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") + + implementation("com.lordcodes.turtle:turtle:0.8.0") } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/task/WebhookExtension.kt b/buildSrc/src/main/kotlin/task/WebhookExtension.kt index 0ece16c7..76fbfb6b 100644 --- a/buildSrc/src/main/kotlin/task/WebhookExtension.kt +++ b/buildSrc/src/main/kotlin/task/WebhookExtension.kt @@ -17,15 +17,15 @@ abstract class WebhookExtension { private val embeds: MutableList = mutableListOf() fun content(content: String) { - this.content = content; + this.content = content } fun username(username: String) { - this.username = username; + this.username = username } fun avatar(avatar: String) { - this.avatar = avatar; + this.avatar = avatar } fun embeds(builder: EmbedsBuilder.() -> Unit) { diff --git a/gradle.properties b/gradle.properties index 44bb1e07..07e6b99b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,6 +3,5 @@ org.gradle.parallel = false org.gradle.warning.mode = all name = CrazyEnvoys -version = 1.4.20.4 group = com.badbones69.crazyenvoys description = Drop custom envoys with any prize you want all over spawn for players to fight over. \ No newline at end of file