Skip to content

Commit

Permalink
[ci-skip] Update build script things
Browse files Browse the repository at this point in the history
[ci-skip] Update build script things
  • Loading branch information
ryderbelserion committed Apr 8, 2023
2 parents 3eb589d + 2716cfa commit 3d5dc7f
Show file tree
Hide file tree
Showing 20 changed files with 116 additions and 340 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build_release.yml
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
#- dev
workflow_dispatch:
inputs:
logLevel:
Expand Down
8 changes: 3 additions & 5 deletions .gitignore
Expand Up @@ -8,9 +8,7 @@ platforms/paper/build
platforms/paper/run/*

!platforms/paper/run/eula.txt
!platforms/paper/run/bukkit.yml
!platforms/paper/run/spigot.yml
!platforms/paper/run/server.properties
!platforms/paper/run/config

build
build

jars
11 changes: 6 additions & 5 deletions README.md
@@ -1,9 +1,9 @@
<br />

[![CrazyEnvoys](https://git.crazycrew.us/ryderbelserion/Assets/raw/branch/main/crazycrew/webp/CrazyEnvoysBanner.webp)](https://modrinth.com/plugin/crazyenvoys)

<div align="center">

[![CrazyEnvoys](https://raw.githubusercontent.com/RyderBelserion/Assets/main/crazycrew/webp/CrazyEnvoysBanner.webp)](https://modrinth.com/plugin/crazyenvoys)

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
Expand Down Expand Up @@ -47,12 +47,13 @@
</ol>
</details>

## Resource Page
### Resource Page
<a href="https://modrinth.com/plugin/crazyenvoys">![Modrinth](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/compact/available/modrinth_46h.png)</a>

### Beta Builds
All beta builds will be on Modrinth marked as beta.<br>
<p>Get the latest changes before marked as release.</p>

<a href="https://modrinth.com/plugin/crazyenvoys">![Modrinth](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/available/modrinth_64h.png)</a>
> https://ci.crazycrew.us/job/CrazyEnvoys/
## Getting Started

Expand Down
41 changes: 33 additions & 8 deletions build.gradle.kts
@@ -1,47 +1,72 @@
import com.lordcodes.turtle.shellRun
import task.WebhookExtension
import java.awt.Color

plugins {
id("crazyenvoys.root-plugin")

id("featherpatcher") version "8ef64e4"
}

val releaseUpdate = Color(27, 217, 106)
val betaUpdate = Color(255, 163, 71)
val changeLogs = Color(37, 137, 204)

val beta = settings.versions.beta.get().toBoolean()
val extension = settings.versions.extension.get()

val color = if (beta) betaUpdate else releaseUpdate
val repo = if (beta) "beta" else "releases"

val url = if (beta) "https://ci.crazycrew.us/job/${rootProject.name}/" else "https://modrinth.com/$extension/${rootProject.name.lowercase()}/versions"
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")

this.username("Ryder Belserion")

this.content("New version of ${rootProject.name} is ready! <@&1029922295210311681>")
this.content(msg)

this.embeds {
this.embed {
this.color(color)

this.fields {
this.field(
"Version ${rootProject.version}",
"Download Link: https://modrinth.com/$extension/${rootProject.name.lowercase()}/version/${rootProject.version}"
"Download: ",
url
)

this.field(
"API Update",
"Version ${rootProject.version} has been pushed to https://repo.crazycrew.us/#/$repo"
"API: ",
"https://repo.crazycrew.us/#/$repo/${rootProject.group.toString().replace(".", "/")}/${rootProject.name.lowercase()}-api/${rootProject.version}"
)
}

this.author(
rootProject.name,
"https://modrinth.com/$extension/${rootProject.name.lowercase()}/versions",
"https://cdn-raw.modrinth.com/data/EMORKQjj/1cf7fffa9bf92d1bc292983dc320984cc764b51e.png"
"${rootProject.name} | Version ${rootProject.version}",
url,
"https://raw.githubusercontent.com/RyderBelserion/assets/main/crazycrew/png/${rootProject.name}Website.png"
)
}

this.embed {
this.color(changeLogs)

this.title("What changed?")

this.description("""
Changes:
» N/A
""".trimIndent())
}
}

this.url("DISCORD_WEBHOOK")
}
20 changes: 10 additions & 10 deletions buildSrc/build.gradle.kts
Expand Up @@ -7,17 +7,17 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
implementation("gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1")
implementation("com.github.johnrengelman:shadow:8.1.0")
implementation(libs.kotlin)
implementation(libs.shadow)

// For the webhook tasks, this applies to the buildSrc only
val ktor = "2.2.4"
implementation(libs.paperweight)

implementation("io.ktor:ktor-client-core-jvm:$ktor")
implementation("io.ktor:ktor-client-cio-jvm:$ktor")
implementation("io.ktor:ktor-client-content-negotiation:$ktor")
implementation("io.ktor:ktor-serialization-gson:$ktor")
implementation(libs.ktor.core)
implementation(libs.ktor.cio)
implementation(libs.ktor.content)
implementation(libs.ktor.gson)

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation(libs.kotlin.coroutines)

implementation(libs.turtle)
}
6 changes: 6 additions & 0 deletions buildSrc/settings.gradle.kts
@@ -1,3 +1,9 @@
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}

repositories.gradlePluginPortal()
}
20 changes: 20 additions & 0 deletions buildSrc/src/main/kotlin/crazyenvoys.paper-plugin.gradle.kts
@@ -1,5 +1,7 @@
plugins {
id("crazyenvoys.root-plugin")

id("io.papermc.paperweight.userdev")
}

repositories {
Expand All @@ -12,4 +14,22 @@ repositories {
* NBT API
*/
maven("https://repo.codemc.io/repository/maven-public/")
}

dependencies {
paperweight.paperDevBundle("1.19.4-R0.1-SNAPSHOT")
}

tasks {
assemble {
dependsOn(reobfJar)
}

reobfJar {
val file = File("$rootDir/jars")

if (!file.exists()) file.mkdirs()

outputJar.set(layout.buildDirectory.file("$file/${rootProject.name}-Paper-${rootProject.version}.jar"))
}
}
31 changes: 7 additions & 24 deletions buildSrc/src/main/kotlin/crazyenvoys.root-plugin.gradle.kts
@@ -1,52 +1,35 @@
import task.ReleaseWebhook
import task.WebhookExtension

plugins {
`java-library`

`maven-publish`

id("com.github.hierynomus.license")

id("com.github.johnrengelman.shadow")
}

repositories {
maven("https://repo.triumphteam.dev/snapshots")

maven("https://libraries.minecraft.net")

maven("https://repo.crazycrew.us/api")

maven("https://jitpack.io")

mavenCentral()
mavenLocal()
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of("17"))
}

tasks {
// Creating the extension to be available on the root gradle
val webhookExtension = extensions.create("webhook", WebhookExtension::class)

// Register the task
register<ReleaseWebhook>("webhook") {
extension = webhookExtension
}

compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
}
}

license {
header = rootProject.file("LICENSE")
encoding = "UTF-8"

mapping("java", "JAVADOC_STYLE")
javadoc {
options.encoding = Charsets.UTF_8.name()
}

include("**/*.java")
processResources {
filteringCharset = Charsets.UTF_8.name()
}
}
52 changes: 0 additions & 52 deletions buildSrc/src/main/kotlin/task/ReleaseWebhook.kt

This file was deleted.

0 comments on commit 3d5dc7f

Please sign in to comment.