9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00

[release-skip] First publish API

This commit is contained in:
violetc
2023-07-22 01:46:58 +08:00
parent d856b9ff14
commit d324bcbd23
4 changed files with 40 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ on:
push: push:
branches: [ master ] branches: [ master ]
pull_request: pull_request:
types: closed types: [ closed ]
branches: [ master ] branches: [ master ]
workflow_dispatch: workflow_dispatch:
@@ -41,9 +41,17 @@ jobs:
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
with: with:
arguments: createReobfPaperclipJar 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 - name: Get Release Info
run: sh scripts/GetReleaseInfo.sh run: sh scripts/GetReleaseInfo.sh
- name: Create Release - name: Create Release
if: !contains(github.event.commits[0].message, '[release-skip]')
uses: ncipollo/release-action@v1.12.0 uses: ncipollo/release-action@v1.12.0
with: with:
artifacts: ${{ env.jar }} artifacts: ${{ env.jar }}

View File

@@ -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. You can visit our [documentation](https://docs.leavesmc.top/leaves) for more information.
## How To (Plugin developers) ## How To (Plugin developers)
In order to use Leaves as a dependency you must [build it yourself](https://github.com/LeavesMC/Leaves#building). Leaves-API:
Each time you want to update your dependency, you must re-build Leaves.
Leaves-API maven dependency:
```kotlin ```kotlin
maven {
name = 'leavesmc-repo'
url = 'https://repo.leavesmc.top/snapshots/'
}
dependencies { dependencies {
compileOnly("top.leavesmc.leaves:leaves-api:1.20.1-R0.1-SNAPSHOT") 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 ```kotlin
dependencies { dependencies {
compileOnly("top.leavesmc.leaves:leaves:1.20.1-R0.1-SNAPSHOT") compileOnly("top.leavesmc.leaves:leaves:1.20.1-R0.1-SNAPSHOT")

View File

@@ -22,15 +22,20 @@ Leaves
如果你想要获得更多信息,那么你可以访问我们的 [文档](https://docs.leavesmc.top/zh/leaves) 如果你想要获得更多信息,那么你可以访问我们的 [文档](https://docs.leavesmc.top/zh/leaves)
## 对于插件开发者 ## 对于插件开发者
如果你要将 Leaves 作为依赖,那么你必须进行 [自行构建](https://github.com/LeavesMC/Leaves/blob/master/README_cn.md#自行构建)
Leaves-API: Leaves-API:
```kotlin ```kotlin
maven {
name = 'leavesmc-repo'
url = 'https://repo.leavesmc.top/snapshots/'
}
dependencies { dependencies {
compileOnly("top.leavesmc.leaves:leaves-api:1.20.1-R0.1-SNAPSHOT") 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: Leaves-Server:
```kotlin ```kotlin
dependencies { dependencies {

View File

@@ -1,5 +1,6 @@
plugins { plugins {
java java
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1" apply false id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.patcher") version "1.5.5" 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)
}
}
}
}