diff --git a/.github/workflows/leaves.yml b/.github/workflows/leaves.yml index 8ba541ba..cc10b907 100644 --- a/.github/workflows/leaves.yml +++ b/.github/workflows/leaves.yml @@ -11,7 +11,7 @@ on: push: branches: [ master ] pull_request: - types: closed + types: [ closed ] branches: [ master ] workflow_dispatch: @@ -41,9 +41,17 @@ jobs: uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 with: arguments: createReobfPaperclipJar + - name: Publish API + uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 + with: + arguments: | + publish + -PleavesUsername={{ secrets.REPO_USERNAME }} + -PleavesPassword={{ secrets.REPO_PASSWORD }} - name: Get Release Info run: sh scripts/GetReleaseInfo.sh - name: Create Release + if: !contains(github.event.commits[0].message, '[release-skip]') uses: ncipollo/release-action@v1.12.0 with: artifacts: ${{ env.jar }} diff --git a/README.md b/README.md index 998b62c6..03f3e9d1 100644 --- a/README.md +++ b/README.md @@ -22,17 +22,22 @@ You can also [build it yourself](https://github.com/LeavesMC/Leaves#building). You can visit our [documentation](https://docs.leavesmc.top/leaves) for more information. ## How To (Plugin developers) -In order to use Leaves as a dependency you must [build it yourself](https://github.com/LeavesMC/Leaves#building). -Each time you want to update your dependency, you must re-build Leaves. - -Leaves-API maven dependency: +Leaves-API: ```kotlin +maven { + name = 'leavesmc-repo' + url = 'https://repo.leavesmc.top/snapshots/' +} + dependencies { compileOnly("top.leavesmc.leaves:leaves-api:1.20.1-R0.1-SNAPSHOT") } ``` -Leaves-Server maven dependency: +In order to use Leaves as a dependency you must [build it yourself](https://github.com/LeavesMC/Leaves#building). +Each time you want to update your dependency, you must re-build Leaves. + +Leaves-Server: ```kotlin dependencies { compileOnly("top.leavesmc.leaves:leaves:1.20.1-R0.1-SNAPSHOT") diff --git a/README_cn.md b/README_cn.md index fdaca1e0..076d3313 100644 --- a/README_cn.md +++ b/README_cn.md @@ -22,15 +22,20 @@ Leaves 如果你想要获得更多信息,那么你可以访问我们的 [文档](https://docs.leavesmc.top/zh/leaves) ## 对于插件开发者 -如果你要将 Leaves 作为依赖,那么你必须进行 [自行构建](https://github.com/LeavesMC/Leaves/blob/master/README_cn.md#自行构建) - Leaves-API: ```kotlin +maven { + name = 'leavesmc-repo' + url = 'https://repo.leavesmc.top/snapshots/' +} + dependencies { compileOnly("top.leavesmc.leaves:leaves-api:1.20.1-R0.1-SNAPSHOT") } ``` +如果你要将 Leaves 作为依赖,那么你必须进行 [自行构建](https://github.com/LeavesMC/Leaves/blob/master/README_cn.md#自行构建) + Leaves-Server: ```kotlin dependencies { diff --git a/build.gradle.kts b/build.gradle.kts index 7e35493a..71f1dca4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,6 @@ plugins { java + `maven-publish` id("com.github.johnrengelman.shadow") version "8.1.1" apply false id("io.papermc.paperweight.patcher") version "1.5.5" } @@ -66,3 +67,16 @@ paperweight { } } } + +allprojects { + apply(plugin = "maven-publish") + + publishing { + repositories { + maven("https://repo.leavesmc.top/snapshots") { + name = "leaves" + credentials(PasswordCredentials::class) + } + } + } +} \ No newline at end of file