From 5551efae519448df3a7e3dbe98bf512d350228aa Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 9 Dec 2025 13:39:11 +0800 Subject: [PATCH 01/11] update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ca025c8..bad7c24 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 3c5642ba67fa1db14deaca42582367cf928367cf Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 9 Dec 2025 15:11:15 +0800 Subject: [PATCH 02/11] use build-in repo data allow use custom repo to download --- .../kotlin/dev/menthamc/harebell/CliMain.kt | 95 +++++++++++-------- .../dev/menthamc/harebell/data/BuildInRepo.kt | 13 +++ ...{MintApiClient.kt => HareBellApiClient.kt} | 4 +- .../menthamc/harebell/data/LauncherConfig.kt | 4 +- .../dev/menthamc/harebell/data/RepoInit.kt | 63 ++++++++++++ .../dev/menthamc/harebell/data/RepoTarget.kt | 4 +- 6 files changed, 140 insertions(+), 43 deletions(-) create mode 100644 src/main/kotlin/dev/menthamc/harebell/data/BuildInRepo.kt rename src/main/kotlin/dev/menthamc/harebell/data/{MintApiClient.kt => HareBellApiClient.kt} (99%) create mode 100644 src/main/kotlin/dev/menthamc/harebell/data/RepoInit.kt diff --git a/src/main/kotlin/dev/menthamc/harebell/CliMain.kt b/src/main/kotlin/dev/menthamc/harebell/CliMain.kt index 3d921fe..b11faaf 100644 --- a/src/main/kotlin/dev/menthamc/harebell/CliMain.kt +++ b/src/main/kotlin/dev/menthamc/harebell/CliMain.kt @@ -1,11 +1,9 @@ package dev.menthamc.harebell -import dev.menthamc.harebell.data.GithubAsset -import dev.menthamc.harebell.data.GithubRelease -import dev.menthamc.harebell.data.LauncherConfigStore -import dev.menthamc.harebell.data.MintApiClient -import dev.menthamc.harebell.data.ProxyTiming -import dev.menthamc.harebell.data.RepoTarget +import RepoInit +import dev.menthamc.harebell.data.* +import java.io.PrintStream +import java.nio.charset.StandardCharsets import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths @@ -22,10 +20,8 @@ object CliMain { @JvmStatic fun main(args: Array) { val configStore = LauncherConfigStore() - val repoTarget = RepoTarget() - val apiClient = MintApiClient(repoTarget = repoTarget) - var config = configStore.load() - + var config = LauncherConfigStore().load() + var repoTarget: RepoTarget? = null val releaseTagInput = System.getProperty("minecraftVersion") ?: config.lastSelectedReleaseTag val installDir = System.getProperty("installDir") @@ -38,6 +34,18 @@ object CliMain { ?: config.extraJvmArgs val jarName = System.getProperty("jarName") ?: config.jarName + val repoOwner = System.getProperty("repoOwner") + ?: config.repoOwner + val repoName = System.getProperty("repoName") + ?: config.repoName + + if (repoOwner == null || repoName == null) { + repoTarget = RepoInit().init() + } else { + repoTarget = RepoTarget(repoOwner, repoName) + } + + val apiClient = HareBellApiClient(repoTarget = repoTarget) val hasConfigFile = configStore.hasExistingConfig() val hasInstallProp = System.getProperty("installDir")?.isNotBlank() == true @@ -49,19 +57,20 @@ object CliMain { showDir = hasConfigFile || hasInstallProp ) configSourcePath?.let { - cliInfo("已找到配置文件: ${it.toAbsolutePath()}") - } ?: cliInfo("未找到配置文件,将使用默认配置并生成 harebell.json") + cliInfo("已找到配置文件 / Configuration file found: ${it.toAbsolutePath()}") + } + ?: cliInfo("未找到配置文件,将使用默认配置并生成 harebell.json / No configuration file found, will use default configuration and generate harebell.json") if (installDir.isBlank()) { - cliError("缺少下载目录:请提供 -DinstallDir=目录 或在配置文件/参数中指定") + cliError("缺少下载目录:请提供 -DinstallDir=目录 或在配置文件/参数中指定 / Missing download directory: Please provide -DinstallDir=directory or specify in config file/parameters") return } val releases = try { - cliStep("获取 Release 列表...") + cliStep("获取 Release 列表... / Fetching Release list...") apiClient.listReleases(limit = 50).filterNot { it.draft } } catch (e: Exception) { - cliError("获取 Release 列表失败: ${e.message}") + cliError("获取 Release 列表失败 / Failed to fetch Release list: ${e.message}") return } @@ -70,15 +79,15 @@ object CliMain { normalizedInput != null && (it.tagName == releaseTagInput || it.tagName.stripLeadingV() == normalizedInput) } ?: releases.firstOrNull() if (release == null) { - cliError("未找到任何 Release") + cliError("未找到任何 Release / No Release found") return } val releaseTag = release.tagName - cliInfo("最新版本: $releaseTag") + cliInfo("最新版本: $releaseTag / Latest version: $releaseTag") - val asset = chooseJarAsset(release) + val asset = chooseJarAsset(release, repoTarget) ?: run { - cliError("该 Release 下没有 jar 资源,请检查 GitHub 页面") + cliError("该 Release 下没有 jar 资源,请检查 GitHub 页面 / No jar assets found in this Release, please check GitHub page") return } @@ -90,18 +99,18 @@ object CliMain { if (Files.exists(target) && config.jarHash.isNotBlank()) { val currentHash = sha256(target) if (currentHash.equals(config.jarHash, ignoreCase = true)) { - cliInfo("本地 hash 与配置一致,跳过下载: $targetName") + cliInfo("本地 hash 与配置一致,跳过下载 / Local hash matches configuration, skipping download: $targetName") needDownload = false finalHash = currentHash } else { - cliInfo("本地 hash 与配置不一致,执行更新: $targetName") + cliInfo("本地 hash 与配置不一致,执行更新 / Local hash does not match configuration, performing update: $targetName") } } if (needDownload) { val proxyChoice = apiClient.resolveDownloadUrl(asset) { timing -> val speedText = timing.bytesPerSec?.let { formatSpeed(it) } ?: "fail" - cliInfo("测速: ${timing.source} -> $speedText") + cliInfo("测速 / Speed test: ${timing.source} -> $speedText") } try { @@ -113,9 +122,9 @@ object CliMain { val speed = t.bytesPerSec?.let { formatSpeed(it) } ?: "fail" "${t.source}=$speed" } - cliInfo("测速: $timingsText") - cliStep("下载: $targetName (源文件: ${asset.name})") - proxyChoice.proxyHost?.let { cliInfo("使用下载源: ${proxyChoice.source} -> $it") } + cliInfo("测速 / Speed test: $timingsText") + cliStep("下载 / Downloading: $targetName (源文件 / source file: ${asset.name})") + proxyChoice.proxyHost?.let { cliInfo("使用下载源: ${proxyChoice.source} -> $it / Using download source: ${proxyChoice.source} -> $it") } apiClient.downloadAsset( asset = asset, target = target, @@ -124,13 +133,13 @@ object CliMain { val totalText = total?.let { "/ ${formatBytes(it)}" } ?: "" val pct = total?.let { (downloaded * 100 / it).coerceIn(0, 100) } val pctText = pct?.let { " ($it%)" } ?: "" - cliProgress("下载进度: ${formatBytes(downloaded)}$totalText$pctText") + cliProgress("下载进度 / Download progress: ${formatBytes(downloaded)}$totalText$pctText") } ) - cliOk("下载完成: $targetName") + cliOk("下载完成 / Download completed: $targetName") finalHash = sha256(target) } catch (e: Exception) { - cliError("下载失败: ${e.message}") + cliError("下载失败 / Download failed: ${e.message}") return } } @@ -141,7 +150,9 @@ object CliMain { maxMemory = mem, jarName = targetName, jarHash = finalHash ?: "", - lastSelectedReleaseTag = releaseTag + lastSelectedReleaseTag = releaseTag, + repoOwner = repoTarget.owner, + repoName = repoTarget.repo ) configStore.save(config) @@ -158,16 +169,16 @@ object CliMain { argsList += target.toAbsolutePath().toString() argsList += config.serverArgs.split(Regex("\\s+")).filter { it.isNotBlank() } - cliStep("启动: ${argsList.joinToString(" ")}") + cliStep("启动 / Launching: ${argsList.joinToString(" ")}") try { val pb = ProcessBuilder(argsList) .directory(Paths.get(installDir).toFile()) .inheritIO() val proc = pb.start() val exit = proc.waitFor() - cliInfo("进程退出,代码=$exit") + cliInfo("进程退出,代码=$exit / Process exited with code=$exit") } catch (e: Exception) { - cliError("启动失败: ${e.message}") + cliError("启动失败 / Launch failed: ${e.message}") } } } @@ -175,7 +186,14 @@ object CliMain { @Suppress("UNUSED_PARAMETER") private fun printIntro(repoUrl: String, installDir: String, jarName: String, showDir: Boolean) { val palette = if (ANSI_ENABLED) { - listOf("\u001B[38;5;45m", "\u001B[38;5;81m", "\u001B[38;5;117m", "\u001B[38;5;153m", "\u001B[38;5;189m", "\u001B[38;5;219m") + listOf( + "\u001B[38;5;45m", + "\u001B[38;5;81m", + "\u001B[38;5;117m", + "\u001B[38;5;153m", + "\u001B[38;5;189m", + "\u001B[38;5;219m" + ) } else { listOf("") } @@ -204,8 +222,8 @@ private fun printIntro(repoUrl: String, installDir: String, jarName: String, sho println() val infoLines = mutableListOf() - infoLines += accent("Harebell 更新程序已准备就绪", "\u001B[38;5;183m") - infoLines += "了解更多: $REPO_URL" + infoLines += accent("Harebell 更新程序已准备就绪 / Harebell Update Program Ready", "\u001B[38;5;183m") + infoLines += "了解更多 / Learn more: $REPO_URL" printBox(infoLines) } @@ -246,11 +264,11 @@ private fun accent(text: String, color: String = "\u001B[38;5;111m"): String = private fun colorize(text: String, color: String): String = if (ANSI_ENABLED && color.isNotEmpty()) "$color$text$ANSI_RESET" else text -private fun chooseJarAsset(release: GithubRelease): GithubAsset? { +private fun chooseJarAsset(release: GithubRelease, repoTarget: RepoTarget): GithubAsset? { val jars = release.assets.filter { it.name.endsWith(".jar", ignoreCase = true) } val preferred = jars.firstOrNull { val n = it.name.lowercase() - "paperclip" in n || "server" in n || "mint" in n || "harebell" in n + "paperclip" in n || "server" in n || repoTarget.repo.lowercase() in n || repoTarget.owner.lowercase() in n } return preferred ?: jars.firstOrNull() } @@ -310,7 +328,8 @@ private fun cliInfo(msg: String) = println("[>] $msg") private fun cliOk(msg: String) = println("[✓] $msg") private fun cliError(msg: String) = println("[!] $msg") -@Volatile private var lastProgress: String? = null +@Volatile +private var lastProgress: String? = null private fun cliProgress(msg: String) { if (msg == lastProgress) return lastProgress = msg diff --git a/src/main/kotlin/dev/menthamc/harebell/data/BuildInRepo.kt b/src/main/kotlin/dev/menthamc/harebell/data/BuildInRepo.kt new file mode 100644 index 0000000..2a0f285 --- /dev/null +++ b/src/main/kotlin/dev/menthamc/harebell/data/BuildInRepo.kt @@ -0,0 +1,13 @@ +package dev.menthamc.harebell.data + +enum class BuildInRepo(val repoTarget: RepoTarget) { + Mint(RepoTarget("MenthaMC", "Mint")), + Luminol(RepoTarget("LuminolMC", "Luminol")), + LightingLuminol(RepoTarget("LuminolMC", "LightingLuminol")), + Lophine(RepoTarget("LuminolMC", "Lophine")), + Leaves(RepoTarget("LeavesMC", "Leaves")), + Leaf(RepoTarget("Winds-Studio", "Leaf")), + Paper(RepoTarget("PaperMC", "Paper")), + Folia(RepoTarget("PaperMC", "Folia")), + Velocity(RepoTarget("PaperMC", "Velocity")), +} diff --git a/src/main/kotlin/dev/menthamc/harebell/data/MintApiClient.kt b/src/main/kotlin/dev/menthamc/harebell/data/HareBellApiClient.kt similarity index 99% rename from src/main/kotlin/dev/menthamc/harebell/data/MintApiClient.kt rename to src/main/kotlin/dev/menthamc/harebell/data/HareBellApiClient.kt index 4720dd2..c5ebf26 100644 --- a/src/main/kotlin/dev/menthamc/harebell/data/MintApiClient.kt +++ b/src/main/kotlin/dev/menthamc/harebell/data/HareBellApiClient.kt @@ -41,8 +41,8 @@ data class GithubRelease( val assets: List = emptyList() ) -class MintApiClient( - private val repoTarget: RepoTarget = RepoTarget(), +class HareBellApiClient( + private val repoTarget: RepoTarget, private val proxySources: List = ProxySource.values().toList() ) { diff --git a/src/main/kotlin/dev/menthamc/harebell/data/LauncherConfig.kt b/src/main/kotlin/dev/menthamc/harebell/data/LauncherConfig.kt index 54e1272..5027498 100644 --- a/src/main/kotlin/dev/menthamc/harebell/data/LauncherConfig.kt +++ b/src/main/kotlin/dev/menthamc/harebell/data/LauncherConfig.kt @@ -15,7 +15,9 @@ data class LauncherConfig( val serverArgs: String = "", val jarName: String = "", val jarHash: String = "", - val lastSelectedReleaseTag: String? = null + val lastSelectedReleaseTag: String? = null, + val repoOwner: String? = null, + val repoName: String? = null ) class LauncherConfigStore( diff --git a/src/main/kotlin/dev/menthamc/harebell/data/RepoInit.kt b/src/main/kotlin/dev/menthamc/harebell/data/RepoInit.kt new file mode 100644 index 0000000..c849f97 --- /dev/null +++ b/src/main/kotlin/dev/menthamc/harebell/data/RepoInit.kt @@ -0,0 +1,63 @@ +import dev.menthamc.harebell.data.BuildInRepo +import dev.menthamc.harebell.data.RepoTarget + +class RepoInit { + fun init(): RepoTarget { + while (true) { + val repos = BuildInRepo.entries.toTypedArray() + + println("请选择要下载的仓库 / Please select a repository to download:") + repos.forEachIndexed { index, buildInRepo -> + val target = buildInRepo.repoTarget + println("${index + 1}. ${buildInRepo.name} (${target.owner}/${target.repo})") + } + println("${repos.size + 1}. 自定义仓库 / Custom repository") + + print("请输入选项编号 / Please enter the option number: ") + val input = readlnOrNull()?.toIntOrNull() + + when { + input != null && input in 1..repos.size -> { + return repos[input - 1].repoTarget + } + + input == repos.size + 1 -> { + val customRepo = createCustomRepoTarget() + if (customRepo != null) { + return customRepo + } + } + + else -> { + println("无效的选择 / Invalid selection") + } + } + } + } + + private fun createCustomRepoTarget(): RepoTarget? { + print("请输入仓库所有者 (owner) / Please enter repository owner: ") + val owner = readlnOrNull()?.trim() + + print("请输入仓库名称 (repo) / Please enter repository name: ") + val repo = readlnOrNull()?.trim() + + if (owner.isNullOrBlank() || repo.isNullOrBlank()) { + println("所有者和仓库名称不能为空 / Owner and repository name cannot be empty") + return null + } + + println("确认信息 / Confirm information:") + println("仓库所有者 / Repository owner: $owner") + println("仓库名称 / Repository name: $repo") + print("是否确认?(Y/N) / Confirm? (Y/N): ") + + val confirm = readlnOrNull()?.trim()?.lowercase() + return if (confirm == "y" || confirm == "yes") { + RepoTarget(owner, repo) + } else { + println("操作已取消 / Operation cancelled") + null + } + } +} diff --git a/src/main/kotlin/dev/menthamc/harebell/data/RepoTarget.kt b/src/main/kotlin/dev/menthamc/harebell/data/RepoTarget.kt index b76701f..45eb566 100644 --- a/src/main/kotlin/dev/menthamc/harebell/data/RepoTarget.kt +++ b/src/main/kotlin/dev/menthamc/harebell/data/RepoTarget.kt @@ -1,6 +1,6 @@ package dev.menthamc.harebell.data data class RepoTarget( - val owner: String = "MenthaMC", - val repo: String = "Mint" + val owner: String, + val repo: String ) From e6cbcef8fa6e46a719e730c37e78ff0c3984ad9d Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 9 Dec 2025 15:11:31 +0800 Subject: [PATCH 03/11] update kt --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 324b16a..0a377e9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,8 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { - kotlin("jvm") version "1.9.22" - kotlin("plugin.serialization") version "1.9.22" + kotlin("jvm") version "2.1.21" + kotlin("plugin.serialization") version "2.1.21" id("com.github.johnrengelman.shadow") version "8.1.1" } From d38f9fe2352100d7b49afbb3028b0bab9930e3fb Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 9 Dec 2025 15:27:26 +0800 Subject: [PATCH 04/11] ci --- .github/workflows/build.yml | 68 +++++++++++++++++++++++++++++++++++++ build.gradle.kts | 3 -- gradle.properties | 4 +++ 3 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 gradle.properties diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0259a8b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,68 @@ +name: Auto Build + +on: + push: + branches: + - "main" + +permissions: write-all + +jobs: + build: + runs-on: ubuntu-latest + environment: default + steps: + - name: Checkout Git Repository + uses: actions/checkout@v6 + + - name: Set Up JDK + uses: actions/setup-java@v5 + with: + distribution: zulu + java-version: 21 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + + - name: Build Harebell + run: | + chmod +x gradlew + ./gradlew --refresh-dependencies shadowJar + + - name : Setup Env + run: | + prop() {grep "^[[:space:]]*${1}" gradle.properties | cut -d'=' -f2 | sed 's/^[[:space:]]*//; s/\r//'} + echo "commit=$(git log --pretty='> [%h] %s' -1)" >> $GITHUB_ENV + echo "version=$(prop version)" >> $GITHUB_ENV + + flag_release=false + pre=false + if [ "$release" = "1" ]; then + flag_release=true + make_latest=true + pre=true + elif [ "$release" = "2" ]; then + flag_release=true + make_latest=true + fi + + echo "pre=$pre" >> $GITHUB_ENV + echo "flag_release=$flag_release" >> $GITHUB_ENV + echo "make_latest=$make_latest" >> $GITHUB_ENV + + + - name: Create Release - No Comment + uses: ncipollo/release-action@v1 + if: env.flag_release == 'true' + with: + tag: ${{ env.version }}-${{ env.commit }} + name: HareBell - + body: | + ### Version Info + > ${{ env.version }}-${{ env.commit }} + This release is automatically compiled by GitHub Actions. + artifacts: | + build/libs/harebell.jar + generateReleaseNotes: true + prerelease: ${{ env.pre }} + makeLatest: ${{ env.make_latest }} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 0a377e9..25da13d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,9 +6,6 @@ plugins { id("com.github.johnrengelman.shadow") version "8.1.1" } -group = "dev.menthamc" -version = "1.0.2" - repositories { mavenCentral() maven("https://repo.menthamc.org/repository/maven-public/") diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..c46b71c --- /dev/null +++ b/gradle.properties @@ -0,0 +1,4 @@ +group = "dev.menthamc" +version = "1.0.2" +release=2 +# 0 for skip release, 1 for pre-release, 2 for release \ No newline at end of file From 21f1aba5c757f7672a24a09214acc59847055262 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 9 Dec 2025 15:36:09 +0800 Subject: [PATCH 05/11] Revert "update kt" This reverts commit e6cbcef8fa6e46a719e730c37e78ff0c3984ad9d. --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 25da13d..a554ec1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,8 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { - kotlin("jvm") version "2.1.21" - kotlin("plugin.serialization") version "2.1.21" + kotlin("jvm") version "1.9.22" + kotlin("plugin.serialization") version "1.9.22" id("com.github.johnrengelman.shadow") version "8.1.1" } From a3bde92362c31e8abb2036434c3b16adf7bd0f99 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 9 Dec 2025 15:36:11 +0800 Subject: [PATCH 06/11] Revert "update gradle" This reverts commit 5551efae519448df3a7e3dbe98bf512d350228aa. --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bad7c24..ca025c8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 5249dc5a59f18e1135e53ed346d2a7012ec09dad Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 9 Dec 2025 15:36:20 +0800 Subject: [PATCH 07/11] oops --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0259a8b..0605f38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: uses: actions/setup-java@v5 with: distribution: zulu - java-version: 21 + java-version: 17 - name: Setup Gradle uses: gradle/actions/setup-gradle@v5 From c58580c107fd524eca17b27a80ba325788d07018 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 9 Dec 2025 15:57:35 +0800 Subject: [PATCH 08/11] fixup --- .github/workflows/build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0605f38..508ca4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,9 @@ jobs: - name : Setup Env run: | - prop() {grep "^[[:space:]]*${1}" gradle.properties | cut -d'=' -f2 | sed 's/^[[:space:]]*//; s/\r//'} + prop() { + grep "^[[:space:]]*${1}" gradle.properties | cut -d'=' -f2 | sed 's/^[[:space:]]*//; s/\r//' + } echo "commit=$(git log --pretty='> [%h] %s' -1)" >> $GITHUB_ENV echo "version=$(prop version)" >> $GITHUB_ENV @@ -49,9 +51,10 @@ jobs: echo "pre=$pre" >> $GITHUB_ENV echo "flag_release=$flag_release" >> $GITHUB_ENV echo "make_latest=$make_latest" >> $GITHUB_ENV + shell: bash - - name: Create Release - No Comment + - name: Create Release uses: ncipollo/release-action@v1 if: env.flag_release == 'true' with: From 8d87f9d5f7607c1840a6ef3fd5aec9a78644cc51 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 9 Dec 2025 16:04:45 +0800 Subject: [PATCH 09/11] fixup * 2 --- .github/workflows/build.yml | 5 ++++- gradle.properties | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 508ca4d..6e99fe7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,8 @@ jobs: prop() { grep "^[[:space:]]*${1}" gradle.properties | cut -d'=' -f2 | sed 's/^[[:space:]]*//; s/\r//' } - echo "commit=$(git log --pretty='> [%h] %s' -1)" >> $GITHUB_ENV + echo "commit=$(git log --pretty='%h' -1)" >> $GITHUB_ENV + echo "commit_msg=$(git log --pretty='> [%h] %s' -1)" >> $GITHUB_ENV echo "version=$(prop version)" >> $GITHUB_ENV flag_release=false @@ -64,6 +65,8 @@ jobs: ### Version Info > ${{ env.version }}-${{ env.commit }} This release is automatically compiled by GitHub Actions. + ### Commit Info + ${{ env.commit_msg }} artifacts: | build/libs/harebell.jar generateReleaseNotes: true diff --git a/gradle.properties b/gradle.properties index c46b71c..98fdd56 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -group = "dev.menthamc" -version = "1.0.2" +group=dev.menthamc +version=1.0.2 release=2 # 0 for skip release, 1 for pre-release, 2 for release \ No newline at end of file From d503d0603541c41bf7ab726f2ae3cadea6048071 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 9 Dec 2025 16:08:54 +0800 Subject: [PATCH 10/11] fixup * 3 --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e99fe7..483012c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,8 +38,10 @@ jobs: echo "commit_msg=$(git log --pretty='> [%h] %s' -1)" >> $GITHUB_ENV echo "version=$(prop version)" >> $GITHUB_ENV + make_latest=false flag_release=false pre=false + release=$(prop release) if [ "$release" = "1" ]; then flag_release=true make_latest=true From 913eb8a98d9fbfcb935a7f15d1e81a9f0bd3e55f Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 9 Dec 2025 16:11:22 +0800 Subject: [PATCH 11/11] fixup * 4 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 483012c..e69bfda 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,7 @@ jobs: if: env.flag_release == 'true' with: tag: ${{ env.version }}-${{ env.commit }} - name: HareBell - + name: HareBell - ${{ env.version }} - ${{ env.commit }} body: | ### Version Info > ${{ env.version }}-${{ env.commit }}