Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
4 changes: 0 additions & 4 deletions .mvn/maven-git-versioning-extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@
${commit.short}-Insider
</version>
</ref>
<ref type = "tag">
<pattern>([0-9].*)></pattern>
<version>${1}</version>
</ref>
</refs>
</configuration>
6 changes: 3 additions & 3 deletions .mvn/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>dough-downstream</id>
<username>StarWishsama</username>
<password>&#103;&#104;&#112;&#95;&#110;&#84;&#77;&#99;&#122;&#76;&#121;&#102;&#53;&#110;&#69;&#65;&#82;&#68;&#80;&#51;&#87;&#120;&#70;&#80;&#51;&#84;&#122;&#118;&#68;&#66;&#74;&#110;&#48;&#75;&#48;&#105;&#81;&#109;&#110;&#88;</password>
<id>gugu-maven-repo</id>
<username>${env.MAVEN_ACCOUNT}</username>
<password>${env.MAVEN_PASSWORD}</password>
</server>
</servers>
</settings>
74 changes: 71 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,79 @@ Slimefun 4 可以在[鬼斩构建站](https://builds.guizhanss.com)页面中**

**! 建议你使用最新的测试版,可以获得最新的内容更新和 Bug 修复!**

## :computer: (开发) 添加依赖

首先添加我们的私有仓库:

Maven:

```xml
<repository>
<id>gugu-maven-repo</id>
<url>https://maven.norain.city/releases</url>
</repository>

```

开发版:
```xml
<repository>
<id>gugu-maven-repo</id>
<url>https://maven.norain.city/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
```

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
<dependency>
<groupId>com.github.SlimefunGuguProject</groupId>
<artifactId>Slimefun4</artifactId>
<version>DEV-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```

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: 截图

Expand Down
45 changes: 31 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
<groupId>com.github.slimefun</groupId>
<artifactId>Slimefun</artifactId>

<!-- Our default version will be UNOFFICIAL, this will prevent auto updates -->
<!-- from overriding our local test file -->
<version>UNOFFICIAL</version>
<version>DEV-SNAPSHOT</version>
<inceptionYear>2013</inceptionYear>
<packaging>jar</packaging>

Expand Down Expand Up @@ -47,17 +45,22 @@
</license>
</licenses>

<distributionManagement>
<repository>
<id>gugu-maven-repo</id>
<name>Gugu Maven Release Repository</name>
<url>https://maven.norain.city/releases</url>
</repository>
<snapshotRepository>
<id>gugu-maven-repo</id>
<name>Gugu Maven Snapshot Repository</name>
<url>https://maven.norain.city/snapshots</url>
</snapshotRepository>
</distributionManagement>

<!-- Repositories that host our dependencies -->
<!-- Well, any that aren't found on maven-central. -->
<repositories>
<!-- Public dough downstream repo -->
<repository>
<id>dough-downstream</id>
<url>https://maven.pkg.github.com/StarWishsama/dough</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<!-- Spigot-API -->
<id>spigot-repo</id>
Expand All @@ -68,6 +71,14 @@
<id>paper-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<!-- Public dough downstream repo -->
<repository>
<id>gugu-maven-repo</id>
<url>https://maven.norain.city/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<!-- ItemsAdder -->
<id>jitpack.io</id>
Expand Down Expand Up @@ -231,10 +242,16 @@
<commitIdGenerationMode>full</commitIdGenerationMode>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
</plugins>

<resources>
<!-- 私有 Maven Repo 发布相关组件 -->

<resources>
<!-- Resources we want to include, e.g. configs or language files -->
<resource>
<directory>${basedir}/src/main/resources</directory>
Expand Down Expand Up @@ -303,9 +320,9 @@

<!-- Shaded packages -->
<dependency>
<groupId>com.github.StarWishsama.dough</groupId>
<groupId>io.github.baked-libs</groupId>
<artifactId>dough-api</artifactId>
<version>a155ce90e3</version>
<version>1.3.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static String itemStack2String(ItemStack itemStack) {
}

return itemStr;
} catch (IOException e) {
} catch (Throwable e) {
e.printStackTrace();
return "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("构建时间 ")
Expand Down
Loading