From b0e13d04de476cd90eacf59c33e680593d8df0b8 Mon Sep 17 00:00:00 2001 From: Sho Sakuma Date: Thu, 26 Mar 2026 06:20:35 +0900 Subject: ci: Support Nightly release CI --- .github/workflows/nightly.yaml | 112 +++++++++++++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 28 ++++++++++- docker/paper/compose.yaml | 47 +++++++++++++++++ 3 files changed, 185 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/nightly.yaml create mode 100644 docker/paper/compose.yaml diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml new file mode 100644 index 0000000..6a162a2 --- /dev/null +++ b/.github/workflows/nightly.yaml @@ -0,0 +1,112 @@ +name: Nightly Release + +on: + push: + branches: + - main + paths-ignore: + - 'docs/**' + - '*.md' + - 'LICENSE' + +concurrency: + group: nightly-release + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-24.04 + outputs: + version: ${{ steps.version.outputs.version }} + paper_jar_name: ${{ steps.version.outputs.paper_jar_name }} + velocity_jar_name: ${{ steps.version.outputs.velocity_jar_name }} + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Compute nightly version + id: version + run: | + BASE_VERSION=$(grep ' version = ' build.gradle.kts | sed 's/.*version = "\(.*\)"/\1/' | sed "s/findProperty.*?: \"\(.*\)\"/\1/") + # Fallback: extract version from the default value + if [ -z "$BASE_VERSION" ] || echo "$BASE_VERSION" | grep -q 'findProperty'; then + BASE_VERSION="1.0.0" + fi + SHORT_HASH=$(git rev-parse --short HEAD) + NIGHTLY_VERSION="${BASE_VERSION}-nightly.${SHORT_HASH}" + echo "version=$NIGHTLY_VERSION" >> $GITHUB_OUTPUT + echo "paper_jar_name=LunaticChat-${NIGHTLY_VERSION}.jar" >> $GITHUB_OUTPUT + echo "velocity_jar_name=LunaticChat-${NIGHTLY_VERSION}-velocity.jar" >> $GITHUB_OUTPUT + echo "Nightly version: $NIGHTLY_VERSION" + + - name: Setup Development Environment + uses: jdx/mise-action@v3 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with shadowJar + run: | + ./gradlew :platform-paper:shadowJar :platform-velocity:shadowJar \ + -Pversion=${{ steps.version.outputs.version }} \ + -PisNightly=true \ + --parallel --no-daemon + + - name: Upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: LunaticChat-nightly-${{ steps.version.outputs.version }} + path: | + platform-paper/build/libs/${{ steps.version.outputs.paper_jar_name }} + platform-velocity/build/libs/${{ steps.version.outputs.velocity_jar_name }} + retention-days: 7 + + release: + runs-on: ubuntu-24.04 + needs: build + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Download build artifact + uses: actions/download-artifact@v8 + with: + name: LunaticChat-nightly-${{ needs.build.outputs.version }} + + - name: Delete existing nightly release + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release delete nightly --yes --cleanup-tag 2>/dev/null || true + + - name: Create nightly release + env: + GH_TOKEN: ${{ github.token }} + run: | + VERSION=${{ needs.build.outputs.version }} + PAPER_JAR_NAME=${{ needs.build.outputs.paper_jar_name }} + VELOCITY_JAR_NAME=${{ needs.build.outputs.velocity_jar_name }} + + gh release create nightly \ + "platform-paper/build/libs/$PAPER_JAR_NAME" \ + "platform-velocity/build/libs/$VELOCITY_JAR_NAME" \ + --title "Nightly Build ($VERSION)" \ + --prerelease \ + --notes "$(cat <<'EOF' + ## ⚠️ Nightly Build + + This is an automatically generated nightly build from the latest `main` branch. + + **Warning:** This build may be unstable or contain bugs. Do not use in production environments. + + - **Version:** `${{ needs.build.outputs.version }}` + - **Commit:** ${{ github.sha }} + + If you encounter any issues, please report them on [GitHub Issues](https://github.com/m1sk9/LunaticChat/issues). + EOF + )" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6360327..c134538 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -81,7 +81,7 @@ jobs: permissions: contents: write env: - MODRINTH_CHANNEL: beta + MODRINTH_CHANNEL: release MODRINTH_GAME_VERSIONS: "1.21.x" MODRINTH_MC_VERSION: "1.21.11" steps: @@ -106,12 +106,36 @@ jobs: PAPER_JAR_NAME=${{ needs.validate.outputs.paper_jar_name }} VELOCITY_JAR_NAME=${{ needs.validate.outputs.velocity_jar_name }} + cat > /tmp/release-notes.md < Date: Thu, 26 Mar 2026 06:21:37 +0900 Subject: feat: Add Night warning to Status Command --- .gitignore | 1 + CHANGELOG.md | 19 +- build.gradle.kts | 2 +- platform-paper/build.gradle.kts | 8 +- .../dev/m1sk9/lunaticChat/paper/BuildInfo.kt | 4 + .../paper/command/impl/lc/StatusCommand.kt | 15 ++ .../command/impl/lcv/VelocityStatusCommand.kt | 9 + .../paper/listener/PlayerChatListener.kt | 2 +- .../paper/listener/PlayerPresenceListener.kt | 18 ++ .../src/main/resources/build-info.properties | 1 + platform-paper/src/main/resources/languages/en.yml | 9 + platform-paper/src/main/resources/languages/ja.yml | 9 + platform-velocity/build.gradle.kts | 20 +- .../dev/m1sk9/lunaticChat/velocity/BuildInfo.kt | 23 ++ .../src/main/resources/build-info.properties | 3 + x | 234 ++++++++++++--------- 16 files changed, 267 insertions(+), 110 deletions(-) create mode 100644 platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/BuildInfo.kt create mode 100644 platform-velocity/src/main/resources/build-info.properties diff --git a/.gitignore b/.gitignore index 729de3c..dc37cdd 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ gradle-app.setting .idea/ docs/.vitepress/cache/deps +/docker/paper/plugins diff --git a/CHANGELOG.md b/CHANGELOG.md index ec0507c..a59c865 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,23 @@ ## v1 -### v1.0.0 (Unreleased) +### v1.0.0 -#### Features +#### Announcement: Support for Nightly Releases -- Paper 26.1 (Minecraft 26.1) is now supported. - - Support for Paper 1.21.X, Folia 1.21.X (and later) has been dropped. +- We have started distributing Nightly releases + - Whenever updates are made to `main` (the default branch), we will distribute the current build via GitHub Releases + - Since the Nightly version is a work-in-progress, it may be unstable or contain bugs. If you encounter any issues, please report them on GitHub Issues + +> [!WARNING] +> +> The Nightly version is not available on Modrinth -## v0 +#### New Features + +- Paper 26.1 (Minecraft 26.1) is now supported. + - Support for Paper 1.21.X, Folia 1.21.X (and later) has been dropped. +- We have added warnings when running `/lc status` or `/lcv status`, or when logging in, if you are using the Nightly version. ### v0.11.0 diff --git a/build.gradle.kts b/build.gradle.kts index 9bda715..ee27d45 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ plugins { allprojects { group = "dev.m1sk9" - version = "0.11.0" + version = findProperty("version")?.toString()?.takeIf { it != "unspecified" } ?: "1.0.0" repositories { mavenCentral() diff --git a/platform-paper/build.gradle.kts b/platform-paper/build.gradle.kts index 0647a1d..b6d452e 100644 --- a/platform-paper/build.gradle.kts +++ b/platform-paper/build.gradle.kts @@ -51,7 +51,13 @@ tasks { .get() .trim() - val props = mapOf("version" to project.version, "gitCommitHash" to gitCommitHash) + val isNightly = providers.gradleProperty("isNightly").orNull?.toBoolean() ?: false + val props = + mapOf( + "version" to project.version, + "gitCommitHash" to gitCommitHash, + "channel" to if (isNightly) "nightly" else "stable", + ) inputs.properties(props) filteringCharset = "UTF-8" filesMatching("paper-plugin.yml") { diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/BuildInfo.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/BuildInfo.kt index 5609fe9..bac9107 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/BuildInfo.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/BuildInfo.kt @@ -5,6 +5,7 @@ import java.util.Properties object BuildInfo { val version: String val commitHash: String + val channel: String init { val props = Properties() @@ -13,7 +14,10 @@ object BuildInfo { } version = props.getProperty("version", "unknown") commitHash = props.getProperty("commit", "unknown") + channel = props.getProperty("channel", "stable") } + val isNightly: Boolean get() = channel == "nightly" + fun versionWithCommit(): String = "$version ($commitHash)" } diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt index 82dcd9f..3a4149c 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt @@ -101,6 +101,13 @@ class StatusCommand( sender.apply { sendMessage(versionLine) + + // Nightly warning + if (BuildInfo.isNightly) { + sendMessage(MessageFormatter.format(languageManager.getMessage("general.nightlyWarning")) + .color(NamedTextColor.YELLOW)) + } + sendMessage(healthLine) // --- Features --- @@ -121,6 +128,14 @@ class StatusCommand( ) sendMessage(getToggleLine(languageManager.getMessage("status.config.debug"), configuration.debug)) sendMessage(getToggleLine(languageManager.getMessage("status.config.checkForUpdates"), configuration.checkForUpdates)) + val channelLabel = languageManager.getMessage("status.channel.${BuildInfo.channel}") + val channelColor = if (BuildInfo.isNightly) NamedTextColor.YELLOW else NamedTextColor.GREEN + sendMessage( + Component + .text(" • ", NamedTextColor.GRAY) + .append(Component.text("${languageManager.getMessage("status.releaseChannel")}: ", NamedTextColor.GRAY)) + .append(Component.text(channelLabel, channelColor)), + ) sendMessage( Component .text(" • ", NamedTextColor.GRAY) diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lcv/VelocityStatusCommand.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lcv/VelocityStatusCommand.kt index 6ebb4f4..9e926fc 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lcv/VelocityStatusCommand.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lcv/VelocityStatusCommand.kt @@ -4,6 +4,7 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder import dev.m1sk9.lunaticChat.engine.command.CommandResult import dev.m1sk9.lunaticChat.engine.permission.LunaticChatPermissionNode import dev.m1sk9.lunaticChat.engine.protocol.ProtocolVersion +import dev.m1sk9.lunaticChat.paper.BuildInfo import dev.m1sk9.lunaticChat.paper.LunaticChat import dev.m1sk9.lunaticChat.paper.command.annotation.Command import dev.m1sk9.lunaticChat.paper.command.annotation.Permission @@ -15,6 +16,7 @@ import dev.m1sk9.lunaticChat.paper.velocity.VelocityConnectionManager import io.papermc.paper.command.brigadier.CommandSourceStack import io.papermc.paper.command.brigadier.Commands import net.kyori.adventure.text.Component +import net.kyori.adventure.text.event.ClickEvent import net.kyori.adventure.text.event.HoverEvent import net.kyori.adventure.text.format.NamedTextColor @@ -138,6 +140,13 @@ class VelocityStatusCommand( languageManager.getMessage("velocity.status.header"), ), ) + + // Nightly warning + if (BuildInfo.isNightly) { + sendMessage(MessageFormatter.format(languageManager.getMessage("general.nightlyWarning")) + .color(NamedTextColor.YELLOW)) + } + // Connection status details connectionStatus.forEach { line -> line?.let { sendMessage(it) } diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerChatListener.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerChatListener.kt index 19b284b..3bd2d4a 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerChatListener.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerChatListener.kt @@ -85,7 +85,7 @@ class PlayerChatListener( when { hasActiveChannel && !hasPrefix -> { // Channel chat: player is in a channel and no '!' prefix - if (channelManager != null && channelMessageHandler != null) { + if (channelMessageHandler != null) { event.isCancelled = true event.viewers().clear() event.message(Component.empty()) diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt index 56cbe59..86a8519 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt @@ -1,13 +1,16 @@ package dev.m1sk9.lunaticChat.paper.listener import dev.m1sk9.lunaticChat.engine.permission.LunaticChatPermissionNode +import dev.m1sk9.lunaticChat.paper.BuildInfo import dev.m1sk9.lunaticChat.paper.LunaticChat import dev.m1sk9.lunaticChat.paper.chat.channel.ChannelManager import dev.m1sk9.lunaticChat.paper.common.hasAnyPermission import dev.m1sk9.lunaticChat.paper.i18n.LanguageManager import dev.m1sk9.lunaticChat.paper.i18n.MessageFormatter import dev.m1sk9.lunaticChat.paper.settings.PlayerSettingsManager +import net.kyori.adventure.text.Component import net.kyori.adventure.text.event.ClickEvent +import net.kyori.adventure.text.format.NamedTextColor import org.bukkit.event.EventHandler import org.bukkit.event.Listener import org.bukkit.event.player.PlayerJoinEvent @@ -39,6 +42,21 @@ class PlayerPresenceListener( }, 3, TimeUnit.SECONDS) } + // Nightly build warning + if (BuildInfo.isNightly) { + lunaticChat.server.asyncScheduler.runDelayed(lunaticChat, { _ -> + if (player.isOnline) { + player.sendMessage(MessageFormatter.format(languageManager.getMessage("general.nightlyWarning")) + .color(NamedTextColor.YELLOW)) + player.sendMessage( + MessageFormatter.format(languageManager.getMessage("general.nightlyReportIssue")) + .clickEvent(ClickEvent.openUrl("https://github.com/m1sk9/LunaticChat/issues")) + .color(NamedTextColor.YELLOW) + ) + } + }, 6, TimeUnit.SECONDS) + } + // Restore active channel from membership and notify (delayed to avoid being buried by other plugins' join messages) channelManager?.let { manager -> val context = manager.restorePlayerChannel(player.uniqueId) diff --git a/platform-paper/src/main/resources/build-info.properties b/platform-paper/src/main/resources/build-info.properties index f093468..1f8dbc2 100644 --- a/platform-paper/src/main/resources/build-info.properties +++ b/platform-paper/src/main/resources/build-info.properties @@ -1,2 +1,3 @@ version=${version} commit=${gitCommitHash} +channel=${channel} diff --git a/platform-paper/src/main/resources/languages/en.yml b/platform-paper/src/main/resources/languages/en.yml index 04ca56a..4f3be82 100644 --- a/platform-paper/src/main/resources/languages/en.yml +++ b/platform-paper/src/main/resources/languages/en.yml @@ -56,6 +56,13 @@ status: ok: "OK" degraded: "Degraded" degradedHover: "Velocity integration is enabled but the connection failed. Use /lcv status for details." + nightlyWarning: "WARNING: This is a nightly build and may be unstable. Do not use in production." + nightlyHover: "Nightly builds are automatically generated from the latest code and have not been tested for stability." + nightlyReportIssue: "If you encounter any issues, please report them on GitHub Issues." + releaseChannel: "Release Channel" + channel: + stable: "Stable" + nightly: "Nightly" settings: availableValues: "Available settings value: {values}" @@ -200,6 +207,8 @@ general: newUpdateAvailable: "The new version of LunaticChat is now available! You can download it from GitHub or Modrinth." noPermission: "You do not have permission to execute this command." spyMessage: "You have been granted permission, so this message is displayed in spy mode." + nightlyWarning: "You are running a nightly build of LunaticChat. This build may be unstable or contain bugs." + nightlyReportIssue: "If you encounter any issues, please report them on GitHub Issues." toggle: off: "Disabled" diff --git a/platform-paper/src/main/resources/languages/ja.yml b/platform-paper/src/main/resources/languages/ja.yml index 74f2dfb..327144e 100644 --- a/platform-paper/src/main/resources/languages/ja.yml +++ b/platform-paper/src/main/resources/languages/ja.yml @@ -56,6 +56,13 @@ status: ok: "正常" degraded: "問題あり" degradedHover: "Velocity 連携が有効ですが接続に失敗しました。/lcv status を確認してください。" + nightlyWarning: "警告: これはナイトリービルドです。不安定な可能性があるため、本番環境では使用しないでください。" + nightlyHover: "ナイトリービルドは最新のコードから自動生成されており、安定性のテストは行われていません。" + nightlyReportIssue: "問題を発見した場合は、GitHub Issues で報告してください。" + releaseChannel: "リリースチャンネル" + channel: + stable: "安定版" + nightly: "ナイトリー" settings: availableValues: "使用可能な設定値: {values}" @@ -200,6 +207,8 @@ general: newUpdateAvailable: "LunaticChat の新しいバージョンが利用可能です。GitHubまたはModrinthからダウンロードできます" noPermission: "このコマンドを実行する権限がありません" spyMessage: "あなたに権限が付与されているため、このメッセージはスパイ状態で表示されています" + nightlyWarning: "LunaticChat のナイトリービルドを使用しています。このビルドは不安定であったり、バグが含まれている可能性があります。" + nightlyReportIssue: "問題を発見した場合は、GitHub Issues で報告してください。" toggle: on: "有効" diff --git a/platform-velocity/build.gradle.kts b/platform-velocity/build.gradle.kts index cc8af58..f6a4e57 100644 --- a/platform-velocity/build.gradle.kts +++ b/platform-velocity/build.gradle.kts @@ -36,12 +36,30 @@ tasks { } processResources { - val props = mapOf("version" to project.version) + val gitCommitHash = + providers + .exec { + commandLine("git", "rev-parse", "--short", "HEAD") + }.standardOutput + .asText + .get() + .trim() + + val isNightly = providers.gradleProperty("isNightly").orNull?.toBoolean() ?: false + val props = + mapOf( + "version" to project.version, + "gitCommitHash" to gitCommitHash, + "channel" to if (isNightly) "nightly" else "stable", + ) inputs.properties(props) filteringCharset = "UTF-8" filesMatching("velocity-plugin.json") { expand(props) } + filesMatching("build-info.properties") { + expand(props) + } } build { diff --git a/platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/BuildInfo.kt b/platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/BuildInfo.kt new file mode 100644 index 0000000..1cb13d4 --- /dev/null +++ b/platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/BuildInfo.kt @@ -0,0 +1,23 @@ +package dev.m1sk9.lunaticChat.velocity + +import java.util.Properties + +object BuildInfo { + val version: String + val commitHash: String + val channel: String + + init { + val props = Properties() + BuildInfo::class.java.getResourceAsStream("/build-info.properties")?.use { + props.load(it) + } + version = props.getProperty("version", "unknown") + commitHash = props.getProperty("commit", "unknown") + channel = props.getProperty("channel", "stable") + } + + val isNightly: Boolean get() = channel == "nightly" + + fun versionWithCommit(): String = "$version ($commitHash)" +} diff --git a/platform-velocity/src/main/resources/build-info.properties b/platform-velocity/src/main/resources/build-info.properties new file mode 100644 index 0000000..1f8dbc2 --- /dev/null +++ b/platform-velocity/src/main/resources/build-info.properties @@ -0,0 +1,3 @@ +version=${version} +commit=${gitCommitHash} +channel=${channel} diff --git a/x b/x index a52964c..aa9a210 100755 --- a/x +++ b/x @@ -2,70 +2,107 @@ set -e +DC_PAPER="docker compose -f docker/paper/compose.yaml" DC_VELOCITY="docker compose -f docker/velocity/compose.yaml" DC_FOLIA="docker compose -f docker/folia/compose.yaml" +GRADLE_EXTRA_ARGS="" + help() { cat < [options] - -Velocity environment (Paper s1 + s2 + Velocity proxy): - start Build Paper+Velocity and start all containers - start-s1 Build Paper and start only s1 container - restart Restart s1, s2 and velocity containers - stop Stop velocity environment - clean Stop velocity environment and remove volumes - rcon [server] Open rcon-cli for server container (default: s1) - Available servers: s1, s2 - logs [server] Show server container logs (default: s1) - Available servers: s1, s2 - vlogs Show velocity proxy container logs - -Folia environment (single Folia server): - folia start Build Paper and start Folia server - folia restart Restart Folia server - folia stop Stop Folia server - folia clean Stop Folia server and remove volumes - folia rcon Open rcon-cli for Folia server - folia logs Show Folia server logs - -General: - help Show this help message +Usage: ./x [--stable] + +Actions: + start Build and start containers + stop Stop containers + log Show container logs + clean Stop containers and remove volumes + rcon Open rcon-cli console (velocity: ./x rcon velocity [s1|s2]) + help Show this help message + +Platforms: + paper Single Paper server (localhost:25565) + velocity Velocity proxy + Paper s1 & s2 (localhost:25577) + folia Single Folia server (localhost:25565) + +Options: + --stable Build as stable release (default: nightly) + +Examples: + ./x start paper Build nightly and start Paper server + ./x start velocity Build nightly and start Velocity environment + ./x start folia Build nightly and start Folia server + ./x start paper --stable Build stable and start Paper server + ./x log velocity Show Velocity environment logs + ./x rcon paper Open rcon-cli for Paper server + ./x stop velocity Stop Velocity environment + ./x clean folia Stop Folia and remove volumes EOF } +setup_nightly() { + SHORT_HASH=$(git rev-parse --short HEAD) + GRADLE_EXTRA_ARGS="-Pversion=1.0.0-nightly.${SHORT_HASH} -PisNightly=true" + echo "==> Nightly build: 1.0.0-nightly.${SHORT_HASH}" +} + ensure_plugin_dir() { mkdir -p "$1" } -# --- Folia commands --- -folia_cmd() { - case "${1:-}" in - start) - ./gradlew :platform-paper:clean :platform-paper:shadowJar +# Parse --stable flag (only setup build for actions that need it) +ACTION="${1:-}" +PLATFORM="${2:-}" + +if [[ "$ACTION" == "start" ]]; then + STABLE=false + for arg in "$@"; do + if [[ "$arg" == "--stable" ]]; then + STABLE=true + fi + done + + if [[ "$STABLE" == "false" ]]; then + setup_nightly + else + echo "==> Stable build" + fi +fi + +# --- Actions per platform --- + +do_start() { + case "$1" in + paper) + ./gradlew :platform-paper:clean :platform-paper:shadowJar $GRADLE_EXTRA_ARGS + ensure_plugin_dir docker/paper/plugins + rm -f docker/paper/plugins/*.jar + cp platform-paper/build/libs/*.jar docker/paper/plugins/ + $DC_PAPER up + ;; + velocity) + ./gradlew :platform-paper:clean :platform-paper:shadowJar :platform-velocity:clean :platform-velocity:shadowJar $GRADLE_EXTRA_ARGS + ensure_plugin_dir docker/velocity/plugins-paper-s1 + ensure_plugin_dir docker/velocity/plugins-paper-s2 + ensure_plugin_dir docker/velocity/plugins-velocity + rm -f docker/velocity/plugins-paper-s1/*.jar + rm -f docker/velocity/plugins-paper-s2/*.jar + rm -f docker/velocity/plugins-velocity/*.jar + cp platform-paper/build/libs/*.jar docker/velocity/plugins-paper-s1/ + cp platform-paper/build/libs/*.jar docker/velocity/plugins-paper-s2/ + cp platform-velocity/build/libs/*.jar docker/velocity/plugins-velocity/ + $DC_VELOCITY up + ;; + folia) + ./gradlew :platform-paper:clean :platform-paper:shadowJar $GRADLE_EXTRA_ARGS ensure_plugin_dir docker/folia/plugins rm -f docker/folia/plugins/*.jar cp platform-paper/build/libs/*.jar docker/folia/plugins/ $DC_FOLIA up ;; - restart) - $DC_FOLIA restart folia - ;; - stop) - $DC_FOLIA down - ;; - clean) - $DC_FOLIA down -v - ;; - rcon) - $DC_FOLIA exec folia rcon-cli - ;; - logs) - $DC_FOLIA logs -f folia - ;; *) - echo "Unknown folia command: ${1:-}" + echo "Unknown platform: ${1:-}" echo "" help exit 1 @@ -73,64 +110,59 @@ folia_cmd() { esac } +do_stop() { + case "$1" in + paper) $DC_PAPER down ;; + velocity) $DC_VELOCITY down ;; + folia) $DC_FOLIA down ;; + *) echo "Unknown platform: ${1:-}"; exit 1 ;; + esac +} + +do_log() { + case "$1" in + paper) $DC_PAPER logs -f paper ;; + velocity) $DC_VELOCITY logs -f ;; + folia) $DC_FOLIA logs -f folia ;; + *) echo "Unknown platform: ${1:-}"; exit 1 ;; + esac +} + +do_clean() { + case "$1" in + paper) $DC_PAPER down -v ;; + velocity) $DC_VELOCITY down -v ;; + folia) $DC_FOLIA down -v ;; + *) echo "Unknown platform: ${1:-}"; exit 1 ;; + esac +} + +do_rcon() { + case "$1" in + paper) $DC_PAPER exec paper rcon-cli ;; + velocity) + local server="${2:-s1}" + if [[ "$server" != "s1" && "$server" != "s2" ]]; then + echo "Error: Invalid server '$server'. Available: s1, s2" + exit 1 + fi + $DC_VELOCITY exec "$server" rcon-cli + ;; + folia) $DC_FOLIA exec folia rcon-cli ;; + *) echo "Unknown platform: ${1:-}"; exit 1 ;; + esac +} + # --- Main --- -case "${1:-}" in - folia) - folia_cmd "${2:-}" - ;; - start) - ./gradlew :platform-paper:clean :platform-paper:shadowJar :platform-velocity:clean :platform-velocity:shadowJar - ensure_plugin_dir docker/velocity/plugins-paper-s1 - ensure_plugin_dir docker/velocity/plugins-paper-s2 - ensure_plugin_dir docker/velocity/plugins-velocity - rm -f docker/velocity/plugins-paper-s1/*.jar - rm -f docker/velocity/plugins-paper-s2/*.jar - rm -f docker/velocity/plugins-velocity/*.jar - cp platform-paper/build/libs/*.jar docker/velocity/plugins-paper-s1/ - cp platform-paper/build/libs/*.jar docker/velocity/plugins-paper-s2/ - cp platform-velocity/build/libs/*.jar docker/velocity/plugins-velocity/ - $DC_VELOCITY up - ;; - start-s1) - ./gradlew :platform-paper:clean :platform-paper:shadowJar - ensure_plugin_dir docker/velocity/plugins-paper-s1 - rm -f docker/velocity/plugins-paper-s1/*.jar - cp platform-paper/build/libs/*.jar docker/velocity/plugins-paper-s1/ - $DC_VELOCITY up s1 - ;; - restart) - $DC_VELOCITY restart s1 s2 velocity - ;; - stop) - $DC_VELOCITY down - ;; - clean) - $DC_VELOCITY down -v - ;; - rcon) - SERVER="${2:-s1}" - if [[ "$SERVER" != "s1" && "$SERVER" != "s2" ]]; then - echo "Error: Invalid server '$SERVER'. Available servers: s1, s2" - exit 1 - fi - $DC_VELOCITY exec "$SERVER" rcon-cli - ;; - logs) - SERVER="${2:-s1}" - if [[ "$SERVER" != "s1" && "$SERVER" != "s2" ]]; then - echo "Error: Invalid server '$SERVER'. Available servers: s1, s2" - exit 1 - fi - $DC_VELOCITY logs -f "$SERVER" - ;; - vlogs) - $DC_VELOCITY logs -f velocity - ;; - help|"") - help - ;; +case "$ACTION" in + start) do_start "$PLATFORM" ;; + stop) do_stop "$PLATFORM" ;; + log) do_log "$PLATFORM" ;; + clean) do_clean "$PLATFORM" ;; + rcon) do_rcon "$PLATFORM" "${3:-}" ;; + help|"") help ;; *) - echo "Unknown command: $1" + echo "Unknown action: $ACTION" echo "" help exit 1 -- cgit v1.2.1 From 532bee66237b5adfde958b27205e4ea43189a043 Mon Sep 17 00:00:00 2001 From: Sho Sakuma Date: Thu, 26 Mar 2026 08:35:49 +0900 Subject: test: Fix StatusCommandTest `verify` value --- codecov.yml | 3 +++ .../dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommandTest.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 822b43f..e23de4b 100644 --- a/codecov.yml +++ b/codecov.yml @@ -18,6 +18,9 @@ ignore: - "platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/**" # BuildInfo loads build-time resources at class init and is verified via integration tests. - "platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/BuildInfo.kt" + # VelocityStatusCommand is tightly coupled to VelocityConnectionManager and has no unit-test + # infrastructure; it is exercised via end-to-end multi-server tests. + - "platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lcv/VelocityStatusCommand.kt" # The Velocity platform has no unit-test infrastructure; it is exercised via end-to-end # multi-server tests (docker compose). - "platform-velocity/src/main/kotlin/**" diff --git a/platform-paper/src/test/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommandTest.kt b/platform-paper/src/test/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommandTest.kt index 039b135..63cf908 100644 --- a/platform-paper/src/test/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommandTest.kt +++ b/platform-paper/src/test/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommandTest.kt @@ -148,7 +148,7 @@ class StatusCommandTest { assertIs(result) // Nightly warning + version + health + features header + 4 features + config header + // debug + checkForUpdates + releaseChannel + language + 3 links = at least 15 messages - verify(atLeast = 5) { deps.mockPlayer.sendMessage(any()) } + verify(atLeast = 15) { deps.mockPlayer.sendMessage(any()) } } finally { unmockkObject(BuildInfo) } -- cgit v1.2.1 From b4ad3086eaaa5280855816a5dd6ed37b939a4659 Mon Sep 17 00:00:00 2001 From: Sho Sakuma Date: Thu, 26 Mar 2026 08:36:12 +0900 Subject: chore: Remove unused language data --- CHANGELOG.md | 6 +++--- platform-paper/src/main/resources/languages/en.yml | 3 --- platform-paper/src/main/resources/languages/ja.yml | 3 --- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a59c865..6f7753e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,8 @@ #### Announcement: Support for Nightly Releases -- We have started distributing Nightly releases - - Whenever updates are made to `main` (the default branch), we will distribute the current build via GitHub Releases +- We have started distributing Nightly releases + - Whenever updates are made to `main` (the default branch), we will distribute the current build via GitHub Releases - Since the Nightly version is a work-in-progress, it may be unstable or contain bugs. If you encounter any issues, please report them on GitHub Issues > [!WARNING] @@ -17,7 +17,7 @@ #### New Features - Paper 26.1 (Minecraft 26.1) is now supported. - - Support for Paper 1.21.X, Folia 1.21.X (and later) has been dropped. + - Support for Paper 1.21.X, Folia 1.21.X (and later) has been dropped. - We have added warnings when running `/lc status` or `/lcv status`, or when logging in, if you are using the Nightly version. ### v0.11.0 diff --git a/platform-paper/src/main/resources/languages/en.yml b/platform-paper/src/main/resources/languages/en.yml index 4f3be82..7db632f 100644 --- a/platform-paper/src/main/resources/languages/en.yml +++ b/platform-paper/src/main/resources/languages/en.yml @@ -56,9 +56,6 @@ status: ok: "OK" degraded: "Degraded" degradedHover: "Velocity integration is enabled but the connection failed. Use /lcv status for details." - nightlyWarning: "WARNING: This is a nightly build and may be unstable. Do not use in production." - nightlyHover: "Nightly builds are automatically generated from the latest code and have not been tested for stability." - nightlyReportIssue: "If you encounter any issues, please report them on GitHub Issues." releaseChannel: "Release Channel" channel: stable: "Stable" diff --git a/platform-paper/src/main/resources/languages/ja.yml b/platform-paper/src/main/resources/languages/ja.yml index 327144e..9a472b9 100644 --- a/platform-paper/src/main/resources/languages/ja.yml +++ b/platform-paper/src/main/resources/languages/ja.yml @@ -56,9 +56,6 @@ status: ok: "正常" degraded: "問題あり" degradedHover: "Velocity 連携が有効ですが接続に失敗しました。/lcv status を確認してください。" - nightlyWarning: "警告: これはナイトリービルドです。不安定な可能性があるため、本番環境では使用しないでください。" - nightlyHover: "ナイトリービルドは最新のコードから自動生成されており、安定性のテストは行われていません。" - nightlyReportIssue: "問題を発見した場合は、GitHub Issues で報告してください。" releaseChannel: "リリースチャンネル" channel: stable: "安定版" -- cgit v1.2.1