9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-21 07:59:26 +00:00

Publish API

This commit is contained in:
Dreeam
2024-07-17 01:30:22 +08:00
parent 6f90851f57
commit 0bae9452af
3 changed files with 31 additions and 13 deletions

View File

@@ -36,14 +36,14 @@ jobs:
mv build/libs/leaf-paperclip-1.21-R0.1-SNAPSHOT-mojmap.jar ./leaf-1.21-mojmap.jar mv build/libs/leaf-paperclip-1.21-R0.1-SNAPSHOT-mojmap.jar ./leaf-1.21-mojmap.jar
mv build/libs/leaf-paperclip-1.21-R0.1-SNAPSHOT-reobf.jar ./leaf-1.21-reobf.jar mv build/libs/leaf-paperclip-1.21-R0.1-SNAPSHOT-reobf.jar ./leaf-1.21-reobf.jar
# - name: Publish API - name: Publish API
# if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
# run: | run: |
# ./gradlew :leaf-api:publish ./gradlew :leaf-api:publish
# ./gradlew publishDevBundlePublicationToLeafRepository -PpublishDevBundle=true ./gradlew publishDevBundlePublicationToLeafRepository -PpublishDevBundle=true
# env: env:
# ORG_GRADLE_PROJECT_leafUsername: ${{ secrets.REPO_USER }} ORG_GRADLE_PROJECT_leafUsername: ${{ secrets.REPO_USER }}
# ORG_GRADLE_PROJECT_leafPassword: ${{ secrets.REPO_PASSWORD }} ORG_GRADLE_PROJECT_leafPassword: ${{ secrets.REPO_PASSWORD }}
- name: Upload Leaf - name: Upload Leaf
uses: actions/upload-artifact@main uses: actions/upload-artifact@main

View File

@@ -47,10 +47,16 @@ Building a Paperclip JAR for distribution:
./gradlew applyPatches && ./gradlew createMojmapPaperclipJar ./gradlew applyPatches && ./gradlew createMojmapPaperclipJar
``` ```
## 🧪 API (WIP) ## 🧪 API
### Maven ### Maven
```xml ```xml
<repository>
<id>leafmc</id>
<url>https://maven.nostal.ink/repository/maven-snapshots/</url>
</repository>
```
```xml
<dependency> <dependency>
<groupId>cn.dreeam.leaf</groupId> <groupId>cn.dreeam.leaf</groupId>
<artifactId>leaf-api</artifactId> <artifactId>leaf-api</artifactId>
@@ -60,9 +66,19 @@ Building a Paperclip JAR for distribution:
``` ```
### Gradle ### Gradle
```kotlin ```kotlin
repositories {
maven {
url = uri("https://maven.nostal.ink/repository/maven-snapshots/")
}
}
dependencies { dependencies {
compileOnly("cn.dreeam.leaf:leaf-api:1.21-R0.1-SNAPSHOT") compileOnly("cn.dreeam.leaf:leaf-api:1.21-R0.1-SNAPSHOT")
} }
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
``` ```
## ⚖️ License ## ⚖️ License

View File

@@ -5,13 +5,14 @@ plugins {
} }
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
val leafMavenPublicUrl = "https://maven.nostal.ink/repository/maven-snapshots/"
repositories { repositories {
mavenCentral() mavenCentral()
maven(paperMavenPublicUrl) { maven(paperMavenPublicUrl) {
content { onlyForConfigurations(configurations.paperclip.name) } content { onlyForConfigurations(configurations.paperclip.name) }
} }
maven("https://maven.nostal.ink/repository/maven-snapshots/") // Quantumleaper maven(leafMavenPublicUrl) // Quantumleaper
} }
dependencies { dependencies {
@@ -86,6 +87,7 @@ tasks.generateDevelopmentBundle {
listOf( listOf(
"https://repo.maven.apache.org/maven2/", "https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl, paperMavenPublicUrl,
leafMavenPublicUrl
) )
) )
} }
@@ -105,10 +107,10 @@ allprojects {
repositories { repositories {
maven { maven {
name = "leaf" name = "leaf"
url = uri("https://maven.pkg.github.com/Winds-Studio/Leaf") url = uri(leafMavenPublicUrl)
credentials.username = System.getenv("REPO_PASSWORD") credentials.username = System.getenv("REPO_USER")
credentials.password = System.getenv("REPO_USER") credentials.password = System.getenv("REPO_PASSWORD")
} }
publications { publications {