Skip to content

Commit

Permalink
It's update time
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed Jul 5, 2024
1 parent c5749fa commit 75367df
Show file tree
Hide file tree
Showing 66 changed files with 986 additions and 1,159 deletions.
102 changes: 99 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
name: Publish Release
env:
NEXT_BUILD_NUMBER: ${{ vars.NEXT_BUILD_NUMBER }}
BUILD_INITIAL_VALUE: 1

on:
push:
branches:
Expand All @@ -13,7 +17,7 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
if: "contains(github.event.commits[0].message, '[build]')"
if: "!contains(github.event.commits[0].message, '[ci-skip]')"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -28,6 +32,47 @@ jobs:
java-version: 21
check-latest: true

- name: Import Gradle Version Catalog
uses: SebRollen/toml-action@v1.2.0
id: minecraft_version
with:
file: gradle/libs.versions.toml
field: versions.minecraft

- uses: actions/github-script@v6
name: Prepare build number if it doesn't exist
with:
debug: true
github-token: ${{ secrets.GH_TOKEN }}
script: |
const { owner, repo } = context.repo;
if (process.env.NEXT_BUILD_NUMBER === undefined || process.env.NEXT_BUILD_NUMBER === "") {
core.info(`Could not find a NEXT_BUILD_NUMBER env variable. Creating a new one with value ${process.env.BUILD_INITIAL_VALUE}.`);
const { status, data } = await github.request('POST /repos/{owner}/{repo}/actions/variables', {
owner: owner,
repo: repo,
name: "NEXT_BUILD_NUMBER",
value: process.env.BUILD_INITIAL_VALUE,
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
}).catch(err => err.response);
//const { status, data } = await github.rest.actions.createRepoVariable(owner, repo, "NEXT_BUILD_NUMBER", process.env.BUILD_INITIAL_VALUE);
core.debug(JSON.stringify(data, null, 2));
if (data?.message != undefined) {
return core.setFailed(`Failed to update configuration variable NEXT_BUILD_NUMBER with new value of '${process.env.BUILD_INITIAL_VALUE}' for reason ${data.message}`);
}
return core.exportVariable("NEXT_BUILD_NUMBER", process.env.BUILD_INITIAL_VALUE);
} else if (process.env.NEXT_BUILD_NUMBER.split('.').length > 1 || Number.isNaN(Number.parseInt(process.env.NEXT_BUILD_NUMBER))) {
return core.setFailed(`NEXT_BUILD_NUMBER variable has invalid value "${process.env.NEXT_BUILD_NUMBER}", failing build.`);
}
return core.exportVariable("NEXT_BUILD_NUMBER", process.env.NEXT_BUILD_NUMBER);
- name: Import gradle properties
id: properties
shell: bash
Expand All @@ -44,5 +89,56 @@ jobs:
env:
HANGAR_KEY: ${{ secrets.HANGAR_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
COMMIT_MESSAGE: ${{ join(github.event.commits.*.message, '<br>* ') }}
run: ./gradlew modrinth --stacktrace
run: ./gradlew modrinth --stacktrace

- name: Notify Discord
uses: granny/actions-status-discord@v1.14.0.pre-0
if: success()
with:
webhook: ${{ secrets.CHATMANAGER_WEBHOOK }}
noprefix: true
title: New build of ChatManager is ready!
description: |
<@&888222546573537280>
Version ${{ steps.minecraft_version.outputs.value }} build ${{ env.NEXT_BUILD_NUMBER }}
Click [here](https://modrinth.com/plugin/chatmanager/version/${{ steps.minecraft_version.outputs.value }}-${{ env.NEXT_BUILD_NUMBER }}) to download!
- name: Notify Discord
uses: granny/actions-status-discord@v1.14.0.pre-0
if: ${{ failure() }}
with:
webhook: ${{ secrets.CHATMANAGER_WEBHOOK }}
noprefix: true
title: Build Failure!
color: 0xff0000
description: |
Version ${{ steps.minecraft_version.outputs.value }} build ${{ env.NEXT_BUILD_NUMBER }}
Click [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) to view the run!
- uses: actions/github-script@v6
name: Increment Build Number
if: success()
with:
debug: true
github-token: ${{ secrets.GH_TOKEN }}
script: |
const { owner, repo } = context.repo;
const value = '' + (${{ env.NEXT_BUILD_NUMBER }} + 1);
core.info(`attempting to update variable 'NEXT_BUILD_NUMBER' to '${value}'.`);
const { status, data } = await github.request('PATCH /repos/{owner}/{repo}/actions/variables/{name}', {
owner: owner,
repo: repo,
name: "NEXT_BUILD_NUMBER",
value: value,
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
}).catch(err => err.response);
//const { data } = await github.rest.actions.updateRepoVariable(owner, repo, "NEXT_BUILD_NUMBER", value)
core.debug(JSON.stringify(data, null, 2));
if (data?.message != undefined) {
return core.setFailed(`Failed to update configuration variable NEXT_BUILD_NUMBER with new value of '${value}'`);
}
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Added:
- 1.20.6 support
### Removed:
- Vault is no longer needed to run the plugin, All messages have `PlaceholderAPI` support.
- Per-group chat format has been removed from the `config.yml` as you can simply use `PlaceholderAPI` and `Group Weights`.
- Hex Color Format can no longer be changed, It did not function very well.
- `Config_Version` from the `config.yml`.
- `Metrics_Enabled` from the `config.yml` as you can disable Metrics in `bStats`.
- `{display_name}`, `{displayname}`, `{world}`, `{online}`, `{ess_player_balance}`, `{ess_player_nickname}`. You can use `PlaceholderAPI` for literally everything.

Removed:
- 1.20.4 support
### Changed:
- Updated `{vault_prefix}` and `{vault_suffix}` to `%luckperms_prefix%` and `%luckperms_suffix%`.
- Vanish Support has been altered, We no longer detect plugins itself but use hopefully a universal method to detect if vanished.
27 changes: 15 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import com.ryderbelserion.feather.tools.formatLog
import com.ryderbelserion.feather.tools.latestCommitHash
import com.ryderbelserion.feather.tools.latestCommitMessage

plugins {
alias(libs.plugins.paperweight)
alias(libs.plugins.shadowJar)
Expand All @@ -11,13 +15,17 @@ base {
archivesName.set(rootProject.name)
}

val buildNumber: String? = System.getenv("BUILD_NUMBER")
val nextNumber: String? = if (System.getenv("NEXT_BUILD_NUMBER") != null) System.getenv("NEXT_BUILD_NUMBER") else "SNAPSHOT"

rootProject.version = if (buildNumber != null) "${libs.versions.minecraft.get()}-$buildNumber" else "3.13"
rootProject.version = "${libs.versions.minecraft.get()}-$nextNumber"

val isSnapshot = false

val content: String = rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8)
val content: String = if (isSnapshot) {
formatLog(latestCommitHash(), latestCommitMessage(), rootProject.name, "Crazy-Crew")
} else {
rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8)
}

dependencies {
paperweight.paperDevBundle(libs.versions.paper.get())
Expand Down Expand Up @@ -49,13 +57,6 @@ tasks {

assemble {
dependsOn(reobfJar)

doLast {
copy {
from(reobfJar.get())
into(rootProject.projectDir.resolve("jars"))
}
}
}

shadowJar {
Expand Down Expand Up @@ -90,14 +91,16 @@ tasks {

projectId.set(rootProject.name.lowercase())

versionType.set(if (isSnapshot) "beta" else "release")
versionType.set("beta")

versionName.set("${rootProject.name} ${rootProject.version}")
versionNumber.set(rootProject.version as String)

changelog.set(content)

uploadFile.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar"))
uploadFile.set(reobfJar.get())

syncBodyFrom.set(rootProject.file("README.md").readText(Charsets.UTF_8))

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

Expand Down
8 changes: 8 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import com.ryderbelserion.feather.feather

plugins {
id("com.ryderbelserion.feather-logic") version "0.0.1"

`kotlin-dsl`
}

dependencies {
feather("0.0.1")
}
14 changes: 14 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@ rootProject.name = "buildSrc"

dependencyResolutionManagement {
repositories {
maven("https://repo.crazycrew.us/releases")

gradlePluginPortal()

mavenCentral()
}
}

pluginManagement {
repositories {
maven("https://repo.crazycrew.us/releases")

gradlePluginPortal()
}
}

plugins {
id("com.ryderbelserion.feather-settings")
}
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/java-plugin.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ plugins {
repositories {
maven("https://repo.codemc.io/repository/maven-public")

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

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

maven("https://jitpack.io")
Expand Down
3 changes: 1 addition & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ minotaur = "2.+"
hangar = "0.1.2"

# Libraries
vital = "1.5.9"
vital = "df306e3"

[plugins]
paperweight = { id = "io.papermc.paperweight.userdev", version.ref = "paperweight" }
Expand All @@ -31,7 +31,6 @@ triumph-cmds = { group = "dev.triumphteam", name = "triumph-cmd-bukkit", version
triumph-gui = { group = "dev.triumphteam", name = "triumph-gui", version = "3.1.7" }

vital-paper = { module = "com.ryderbelserion.vital:paper", version.ref = "vital" }
vital-core = { module = "com.ryderbelserion.vital:core", version.ref = "vital" }

vault = { group = "com.github.MilkBowl", name = "VaultAPI", version = "1.7.1" }
metrics = { group = "org.bstats", name = "bstats-bukkit", version = "3.0.2" }
Expand Down
2 changes: 1 addition & 1 deletion run/ops.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"uuid": "45123240-248b-44e3-93c9-5c89093ffaad",
"name": "Asruna",
"name": "ryderbelserion",
"level": 4,
"bypassesPlayerLimit": false
}
Expand Down
Binary file removed run/plugins/Vault.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion run/server.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#Minecraft server properties
#Mon Jun 17 19:38:30 EDT 2024
#Thu Jul 04 21:50:33 EDT 2024
accepts-transfers=false
allow-flight=false
allow-nether=false
broadcast-console-to-ops=false
broadcast-rcon-to-ops=false
bug-report-link=
debug=false
difficulty=peaceful
enable-command-block=false
Expand Down
4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ pluginManagement {

gradlePluginPortal()
}
}

plugins {
id("com.ryderbelserion.feather-settings") version "0.0.1"
}
52 changes: 0 additions & 52 deletions src/main/java/com/ryderbelserion/chatmanager/api/CrazyManager.java

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/java/com/ryderbelserion/chatmanager/enums/Files.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public enum Files {
Files(final String fileName) {
this.fileName = fileName;
this.strippedName = this.fileName.replace(".yml", "");
this.configuration = this.plugin.getFileManager().getFile(this.fileName);
this.configuration = this.fileManager.getFile(this.fileName);
}

public final String getFileName() {
Expand All @@ -44,6 +44,6 @@ public final YamlConfiguration getConfiguration() {
}

public void save() {
this.plugin.getFileManager().saveFile(this.fileName);
this.fileManager.saveFile(this.fileName);
}
}
Loading

0 comments on commit 75367df

Please sign in to comment.