Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ jobs:
with:
distribution: temurin
java-version: 21
- name: Read Version Catalog
uses: SebRollen/toml-action@v1.2.0
id: chatmanager_version
with:
file: "gradle/libs.versions.toml"
field: "versions.chatmanager"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Make gradlew executable
Expand All @@ -30,6 +24,10 @@ jobs:
run: ./gradlew modrinth --stacktrace
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
- name: Publish to Hangar
run: ./gradlew publishAllPublicationsToHangar --stacktrace
env:
HANGAR_KEY: ${{ secrets.HANGAR_KEY }}
- name: Notify Discord
if: success()
run: ./gradlew release-build --stacktrace
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/snapshots.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Snapshot Build
env:
IS_SNAPSHOT: true
on:
workflow_dispatch:
push:
branches:
- main
- dev

jobs:
build:
Expand All @@ -28,6 +26,11 @@ jobs:
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
COMMIT_MESSAGE: ${{ join(github.event.commits.*.message, '<br>') }}
- name: Publish to Hangar
run: ./gradlew publishAllPublicationsToHangar --stacktrace
env:
HANGAR_KEY: ${{ secrets.HANGAR_KEY }}
COMMIT_MESSAGE: ${{ join(github.event.commits.*.message, '<br>') }}
- name: Notify Discord
if: success()
run: ./gradlew dev-build --stacktrace
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ build/

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

### Output
jars/
70 changes: 53 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,20 @@ rootProject.group = "me.h1dd3nxn1nja.chatmanager"
val git = feather.getGit()

val commitHash: String? = git.getCurrentCommitHash().subSequence(0, 7).toString()
val isSnapshot: Boolean = System.getenv("IS_SNAPSHOT") != null
val isSnapshot: Boolean = git.getCurrentBranch() == "dev"
val content: String = if (isSnapshot) "[$commitHash](https://github.com/Crazy-Crew/${rootProject.name}/commit/$commitHash) ${git.getCurrentCommit()}" else rootProject.file("changelog.md").readText(Charsets.UTF_8)
val minecraft = libs.versions.minecraft.get()
val versions = listOf(minecraft)

rootProject.version = version()
rootProject.version = if (isSnapshot) "$minecraft-$commitHash" else libs.versions.chatmanager.get()
rootProject.description = "The kitchen sink of Chat Management!"

fun version(): String {
if (isSnapshot) {
return "${libs.versions.minecraft.get()}-$commitHash"
}

return libs.versions.chatmanager.get()
}

feather {
rootDirectory = rootProject.rootDir.toPath()

val data = git.getCurrentCommitAuthorData().copy(author = git.getCurrentCommitAuthorName())
val data = git.getGithubCommit("Crazy-Crew/${rootProject.name}")

val user = data.user

discord {
webhook {
Expand All @@ -39,9 +35,9 @@ feather {
post(System.getenv("BUILD_WEBHOOK"))
}

username(data.author)
username("Ryder Belserion")

avatar(data.avatar)
avatar("https://github.com/ryderbelserion.png")

embeds {
embed {
Expand Down Expand Up @@ -77,9 +73,9 @@ feather {
post(System.getenv("BUILD_WEBHOOK"))
}

username(data.author)
username(user.getName())

avatar(data.avatar)
avatar(user.avatar)

content("<@&1372358375433834537>")

Expand Down Expand Up @@ -155,7 +151,7 @@ modrinth {

changelog = content

gameVersions.addAll(listOf(libs.versions.minecraft.get()))
gameVersions.addAll(versions)

uploadFile = tasks.jar.get().archiveFile.get()

Expand All @@ -165,4 +161,44 @@ modrinth {

autoAddDependsOn = false
detectLoaders = false
}
}

hangarPublish {
publications.register("plugin") {
apiKey.set(System.getenv("HANGAR_KEY"))

id.set(rootProject.name)

version.set(rootProject.version as String)

channel.set(if (isSnapshot) "Beta" else "Release")

changelog.set(content)

platforms {
paper {
jar = tasks.jar.flatMap { it.archiveFile }

platformVersions.set(versions)

dependencies {
hangar("PlaceholderAPI") {
required = false
}

hangar("Essentials") {
required = false
}

url("SuperVanish", "https://www.spigotmc.org/resources/supervanish-be-invisible.1331/") {
required = false
}

url("Vault", "https://www.spigotmc.org/resources/vault.34315/") {
required = false
}
}
}
}
}
}
82 changes: 39 additions & 43 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
[versions]
## Paper
paperweight = "2.0.0-beta.17" # https://github.com/PaperMC/paperweight
paper = "1.21.5-R0.1-SNAPSHOT" # https://github.com/PaperMC/Paper

## Minecraft
minecraft = "1.21.5" # https://minecraft.net

## Plugin API
placeholderapi = "2.11.6" # https://github.com/placeholderapi
essentials = "2.20.1" # https://github.com/EssentialsX/Essentials
vault = "1.7.1" # https://github.com/MilkBowl/Vault

## Other
bStats = "3.1.0" # https://github.com/Bastian/bStats
fusion = "1.6.0" # https://github.com/ryderbelserion/Fusion

## ChatManager
chatmanager = "4.0.3"

## Gradle Plugins
fix-javadoc = "1.19" # https://github.com/mfnalex/gradle-fix-javadoc-plugin
run-paper = "2.3.1" # https://github.com/jpenilla/run-task
minotaur = "2.8.7" # https://github.com/modrinth/minotaur
feather = "0.4.0" # https://github.com/ryderbelserion/Feather
hangar = "0.1.3" # https://github.com/HangarMC/hangar-publish-plugin
shadow = "9.0.0-beta13" # https://github.com/GradleUp/shadow

[plugins]
# https://github.com/ryderbelserion/Feather
feather = { id = "com.ryderbelserion.feather.core", version.ref = "feather" }
# https://github.com/HangarMC/hangar-publish-plugin
hangar = { id = "io.papermc.hangar-publish-plugin", version.ref = "hangar" }
# https://github.com/modrinth/minotaur
minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" }

[libraries]
# https://github.com/PaperMC/paperweight
paperweight = { module = "io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin", version.ref = "paperweight" }
Expand All @@ -15,56 +51,16 @@ paper = { module = "io.papermc.paper:paper-api", version.ref = "paper" }
placeholder-api = { group = "me.clip", name = "placeholderapi", version.ref = "placeholderapi" }
essentials = { group = "net.essentialsx", name = "EssentialsX", version.ref = "essentials" }

# Fusion API
# https://github.com/ryderbelserion/Fusion
fusion-paper = { module = "com.ryderbelserion.fusion:fusion-paper", version.ref = "fusion" }
fusion-core = { module = "com.ryderbelserion.fusion:fusion-core", version.ref = "fusion" }

# bStats API
# https://github.com/Bastian/bStats
metrics = { module = "org.bstats:bstats-bukkit", version.ref = "bStats" }

# Vault API
# https://github.com/MilkBowl/Vault
vault = { group = "com.github.MilkBowl", name = "VaultAPI", version.ref = "vault" }

[versions]
paperweight = "2.0.0-beta.17" # https://github.com/PaperMC/paperweight
paper = "1.21.5-R0.1-SNAPSHOT" # https://github.com/PaperMC/Paper
run-paper = "2.3.1" # https://github.com/jpenilla/run-task
minecraft = "1.21.5"

## GradleUp
shadow = "9.0.0-beta13" # https://github.com/GradleUp/shadow

## Plugin API
placeholderapi = "2.11.6" # https://github.com/placeholderapi
itemsadder = "4.0.10" # https://github.com/ItemsAdder
oraxen = "1.190.0" # https://github.com/oraxen
nexo = "1.6.0" # https://github.com/Nexo-MC

# Essentials API
essentials = "2.20.1"

bStats = "3.1.0" # https://github.com/Bastian/bStats

# Vault API
vault = "1.7.1"

## Gradle Plugins
feather = "0.3.2" # https://github.com/ryderbelserion/Feather
minotaur = "2.8.7" # https://github.com/modrinth/minotaur
hangar = "0.1.3" # https://github.com/HangarMC/hangar-publish-plugin

fusion = "1.6.0" # https://github.com/ryderbelserion/Fusion

chatmanager = "4.0.3"

[plugins]
# https://github.com/ryderbelserion/Feather
feather = { id = "com.ryderbelserion.feather.core", version.ref = "feather" }
# https://github.com/HangarMC/hangar-publish-plugin
hangar = { id = "io.papermc.hangar-publish-plugin", version.ref = "hangar" }
# https://github.com/modrinth/minotaur
minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" }

[bundles]
build = [
"shadow"
Expand Down
8 changes: 8 additions & 0 deletions paper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ tasks {
}

shadowJar {
archiveBaseName.set("${rootProject.name}-${rootProject.version}")

copy {
from(project.layout.buildDirectory.dir("libs"))
into(rootProject.layout.buildDirectory.dir("libs"))
}

listOf(
"com.ryderbelserion.fusion",
"org.bstats"
Expand Down Expand Up @@ -67,6 +74,7 @@ tasks {

runServer {
jvmArgs("-Dnet.kyori.ansi.colorLevel=truecolor")
jvmArgs("-Dcom.mojang.eula.agree=true")

defaultCharacterEncoding = Charsets.UTF_8.name()

Expand Down
43 changes: 0 additions & 43 deletions paper/run/bukkit.yml

This file was deleted.

Loading
Loading