3 Commits

Author SHA1 Message Date
0b8614fec9 ci: 优化构建脚本 2025-08-23 04:12:30 +08:00
b9be8e4b0b ci: 优化构建脚本 2025-08-23 04:11:29 +08:00
594bdf15b6 fix: 修复插件自动更新时下载 URL 显示错误的问题
All checks were successful
Publish Project / build (push) Successful in 2m45s
2025-07-30 20:41:56 +08:00
7 changed files with 11 additions and 24 deletions

View File

@@ -17,12 +17,11 @@ jobs:
java-version: 21
distribution: temurin
cache: gradle
cache-dependency-path: gradle/wrapper/gradle-wrapper.properties
- name: Build Project
env:
ORG_GRADLE_PROJECT_MAVEN_AIRGAME_USERNAME: ${{ secrets.MAVEN_AIRGAME_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_AIRGAME_PASSWORD: ${{ secrets.MAVEN_AIRGAME_PASSWORD }}
run: chmod +x gradlew && ./gradlew build publish --no-daemon
run: chmod +x gradlew && ./gradlew build publish --console plain --no-daemon
- name: Publish to Release
uses: softprops/action-gh-release@v2
with:

View File

@@ -24,9 +24,9 @@ repositories {
dependencies {
// 对于 Bukkit 插件
compileOnly("cn.hamster3.mc.plugin:core-bukkit:1.4.1")
compileOnly("cn.hamster3.mc.plugin:core-bukkit:1.4.2")
// 对于 BungeeCord 插件
compileOnly("cn.hamster3.mc.plugin:core-bungee:1.4.1")
compileOnly("cn.hamster3.mc.plugin:core-bungee:1.4.2")
}
```
@@ -52,13 +52,13 @@ dependencies {
<dependency>
<groupId>cn.hamster3.mc.plugin</groupId>
<artifactId>core-bukkit</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
</dependency>
<!--对于 BungeeCord 插件-->
<dependency>
<groupId>cn.hamster3.mc.plugin</groupId>
<artifactId>core-bungee</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
</dependency>
</dependencies>
</project>

View File

@@ -5,7 +5,7 @@ plugins {
}
group = "cn.hamster3.mc.plugin"
version = "1.4.1"
version = "1.4.2"
description = "叁只仓鼠的 Minecraft 插件开发通用工具包"
subprojects {

View File

@@ -50,11 +50,7 @@ tasks {
shadowJar {
dependsOn(":core-relocate-lettuce:shadowJar")
val task = project(":core-relocate-lettuce").tasks.shadowJar.get()
from(task.outputs.files.map {
if (it.isDirectory) it else zipTree(
it
)
})
from(task.outputs.files.map { if (it.isDirectory) it else zipTree(it) })
destinationDirectory = rootProject.layout.buildDirectory
relocate("de.tr7zw.changeme.nbtapi", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi")
relocate("de.tr7zw.annotations", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi.annotations")

View File

@@ -42,11 +42,7 @@ tasks {
shadowJar {
dependsOn(":core-relocate-lettuce:shadowJar")
val task = project(":core-relocate-lettuce").tasks.shadowJar.get()
from(task.outputs.files.map {
if (it.isDirectory) it else zipTree(
it
)
})
from(task.outputs.files.map { if (it.isDirectory) it else zipTree(it) })
destinationDirectory = rootProject.layout.buildDirectory
}
}

View File

@@ -47,7 +47,7 @@ public final class UpdateCheckUtils {
case "GITEA_RELEASES": {
lastRelease = getGiteaLastRelease(baseUrl, gitRepo, gitToken);
if (downloadUrl == null) {
downloadUrl = URI.create(baseUrl).resolve(gitRepo).toString();
downloadUrl = URI.create(baseUrl).resolve("/" + gitRepo).toString();
}
break;
}
@@ -58,7 +58,7 @@ public final class UpdateCheckUtils {
}
lastRelease = getGitlabLastRelease(baseUrl, projectID, gitToken);
if (downloadUrl == null) {
downloadUrl = URI.create(baseUrl).resolve(gitRepo).toString();
downloadUrl = URI.create(baseUrl).resolve("/" + gitRepo).toString();
}
break;
}

View File

@@ -56,11 +56,7 @@ tasks {
shadowJar {
dependsOn(":core-relocate-lettuce:shadowJar")
val task = project(":core-relocate-lettuce").tasks.shadowJar.get()
from(task.outputs.files.map {
if (it.isDirectory) it else zipTree(
it
)
})
from(task.outputs.files.map { if (it.isDirectory) it else zipTree(it) })
destinationDirectory = rootProject.layout.buildDirectory
}
}