diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index cecde6ce3c..82bc9a819a 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -26,8 +26,16 @@ jobs: cache: maven - name: Codestyle check run: mvn -s .mvn/settings.xml -B spotless:check --errors + - name: Publish snapshots + run: | + echo "::add-mask::$MAVEN_ACCOUNT" + echo "::add-mask::$MAVEN_PASSWORD" + mvn -s .mvn/settings.xml -B deploy -Dversioning.disable --errors + env: + MAVEN_ACCOUNT: '${{ vars.MAVEN_ACCOUNT }}' + MAVEN_PASSWORD: '${{ secrets.MAVEN_PASSWORD }}' - name: Build Slimefun - run: mvn -s .mvn/settings.xml -B package --errors + run: mvn -s .mvn/settings.xml -B clean package --errors - name: Mask Output run: | echo "::add-mask::$CF_API_TOKEN" @@ -36,10 +44,10 @@ jobs: - name: Get build artifact filename run: | cd target && FILENAME=$(find . -maxdepth 1 -mindepth 1 -name "Slimefun-*" | cut -d'/' -f 2) - echo "slimefun-artifact-name=$FILENAME" >> "$GITHUB_ENV" + echo "SLIMEFUN_ARTIFACT_NAME=$FILENAME" >> "$GITHUB_ENV" cd .. - name: Upload Build to R2 uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CF_API_TOKEN }} - command: "r2 object put slimefun-dev/${{ env.slimefun-artifact-name }} --file=./target/${{ env.slimefun-artifact-name }} --content-type=application/java-archive" + command: "r2 object put slimefun-dev/${{ env.SLIMEFUN_ARTIFACT_NAME }} --file=./target/${{ env.SLIMEFUN_ARTIFACT_NAME }} --content-type=application/java-archive" diff --git a/.mvn/maven-git-versioning-extension.xml b/.mvn/maven-git-versioning-extension.xml index 1677a00c94..eba20e0705 100644 --- a/.mvn/maven-git-versioning-extension.xml +++ b/.mvn/maven-git-versioning-extension.xml @@ -11,9 +11,5 @@ ${commit.short}-Insider - - ([0-9].*)> - ${1} - \ No newline at end of file diff --git a/.mvn/settings.xml b/.mvn/settings.xml index 8679032c89..97c4afb339 100644 --- a/.mvn/settings.xml +++ b/.mvn/settings.xml @@ -4,9 +4,9 @@ http://maven.apache.org/xsd/settings-1.0.0.xsd"> - dough-downstream - StarWishsama - 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 + gugu-maven-repo + ${env.MAVEN_ACCOUNT} + ${env.MAVEN_PASSWORD} \ No newline at end of file diff --git a/README.md b/README.md index d52c1f7c7d..55c8d6141e 100644 --- a/README.md +++ b/README.md @@ -72,11 +72,79 @@ Slimefun 4 可以在[鬼斩构建站](https://builds.guizhanss.com)页面中** **! 建议你使用最新的测试版,可以获得最新的内容更新和 Bug 修复!** +## :computer: (开发) 添加依赖 + +首先添加我们的私有仓库: + +Maven: + +```xml + + gugu-maven-repo + https://maven.norain.city/releases + + +``` + +开发版: +```xml + + gugu-maven-repo + https://maven.norain.city/snapshots + + true + + +``` + +Gradle: 在 `build.gradle` 中添加以下内容: + +```groovy +repositories { + maven { + url "https://maven.norain.city/releases" + } +} +``` + +对于开发版: +```groovy +repositories { + maven { + url "https://maven.norain.city/snapshots" + } +} +``` + +接下来添加 Slimefun 4 作为依赖: +Maven: + +```xml + + com.github.SlimefunGuguProject + Slimefun4 + DEV-SNAPSHOT + provided + +``` + +Gradle: + +```groovy +dependencies { + compileOnly 'com.github.SlimefunGuguProject:Slimefun4:DEV-SNAPSHOT' +} +``` + + ## :computer: 如何编译 要编译 Slimefun4,你必须先安装 [Git](https://git-scm.com/) -然后 `git clone https://github.com/SlimefunGuguProject/Slimefun4.git` -最后如果你是 Windows 系统: `.\mvnw.cmd package` -如果你是类 Unix 系统: `.\mvnw package` + +然后运行 `git clone https://github.com/SlimefunGuguProject/Slimefun4.git` 克隆仓库到本地。 + +最后进行编译: +- 如果你是 Windows 系统: `.\mvnw.cmd package` +- 如果你是类 Unix 系统: `.\mvnw package` ## :framed_picture: 截图 diff --git a/pom.xml b/pom.xml index 4dd8d268f1..646b7252e2 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,7 @@ com.github.slimefun Slimefun - - - UNOFFICIAL + DEV-SNAPSHOT 2013 jar @@ -47,17 +45,22 @@ + + + gugu-maven-repo + Gugu Maven Release Repository + https://maven.norain.city/releases + + + gugu-maven-repo + Gugu Maven Snapshot Repository + https://maven.norain.city/snapshots + + + - - - dough-downstream - https://maven.pkg.github.com/StarWishsama/dough - - true - - spigot-repo @@ -68,6 +71,14 @@ paper-repo https://repo.papermc.io/repository/maven-public/ + + + gugu-maven-repo + https://maven.norain.city/snapshots + + true + + jitpack.io @@ -231,10 +242,16 @@ full + + + org.apache.maven.plugins + maven-deploy-plugin + - + + ${basedir}/src/main/resources @@ -303,9 +320,9 @@ - com.github.StarWishsama.dough + io.github.baked-libs dough-api - a155ce90e3 + 1.3.1-SNAPSHOT compile diff --git a/src/main/java/com/xzavier0722/mc/plugin/slimefun4/storage/util/DataUtils.java b/src/main/java/com/xzavier0722/mc/plugin/slimefun4/storage/util/DataUtils.java index e6b9aa1a47..6e871ca16c 100644 --- a/src/main/java/com/xzavier0722/mc/plugin/slimefun4/storage/util/DataUtils.java +++ b/src/main/java/com/xzavier0722/mc/plugin/slimefun4/storage/util/DataUtils.java @@ -37,7 +37,7 @@ public static String itemStack2String(ItemStack itemStack) { } return itemStr; - } catch (IOException e) { + } catch (Throwable e) { e.printStackTrace(); return ""; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/VersionsCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/VersionsCommand.java index 9ca11acb45..ee6124d94a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/VersionsCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/VersionsCommand.java @@ -68,8 +68,8 @@ public void onExecute(@Nonnull CommandSender sender, @Nonnull String[] args) { .color(ChatColor.GREEN) .append(Slimefun.getVersion() + (Slimefun.getVersion().toLowerCase(Locale.ROOT).contains("release") - ? " (" + EnvUtil.getBuildCommitID() + "@" + EnvUtil.getBranch() + ")" - : "") + ? "" + : " @" + EnvUtil.getBranch()) + '\n') .color(ChatColor.DARK_GREEN) .append("构建时间 ")