From 0bb19b4fdc477569070db8980b0f911ad934e7cb Mon Sep 17 00:00:00 2001 From: DuoDuoJuZi <1792249551@qq.com> Date: Mon, 23 Dec 2024 22:54:46 +0800 Subject: [PATCH 1/5] feat: github packages and set jdk to graalvm21 --- legacy-lands-library | 1 + 1 file changed, 1 insertion(+) create mode 160000 legacy-lands-library diff --git a/legacy-lands-library b/legacy-lands-library new file mode 160000 index 0000000..80a0d4a --- /dev/null +++ b/legacy-lands-library @@ -0,0 +1 @@ +Subproject commit 80a0d4a3d4e6e8b861b94560ba1b31df174ad421 From b37ab6e02cd457549d67161d82c789f230a3509a Mon Sep 17 00:00:00 2001 From: DuoDuoJuZi <105411098+DuoDuoJuZi@users.noreply.github.com> Date: Mon, 23 Dec 2024 23:01:20 +0800 Subject: [PATCH 2/5] feat: github packages and set jdk to graalvm21 --- .github/workflows/main.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 503df0d..67fda73 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,17 +11,17 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - + - name: Setup Java JDK uses: actions/setup-java@v3 with: java-version: 21 - distribution: 'zulu' + distribution: 'graalvm' cache: 'gradle' - + - name: Make gradlew executable run: chmod +x gradlew - + - name: Build with Gradle run: ./gradlew shadowJar @@ -32,6 +32,11 @@ jobs: - name: Get Repository Name uses: MariachiBear/get-repo-name-action@v1.1.0 + - name: Publish to GitHub Packages + run: ./gradlew publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/upload-artifact@v4.5.0 with: name: ${{ steps.repo-name.outputs.repository-name }} ${{ steps.short_sha.outputs.sha_short }} -annotation @@ -40,20 +45,20 @@ jobs: - uses: actions/upload-artifact@v4.5.0 with: name: ${{ steps.repo-name.outputs.repository-name }} ${{ steps.short_sha.outputs.sha_short }} -cache - path: | + path: | cache/build/libs/*.jar - uses: actions/upload-artifact@v4.5.0 with: name: ${{ steps.repo-name.outputs.repository-name }} ${{ steps.short_sha.outputs.sha_short }} -configuration - path: | + path: | configuration/build/libs/*.jar - uses: actions/upload-artifact@v4.5.0 with: name: ${{ steps.repo-name.outputs.repository-name }} ${{ steps.short_sha.outputs.sha_short }} -commons - path: | + path: | commons/build/libs/*.jar - uses: actions/upload-artifact@v4.5.0 with: name: ${{ steps.repo-name.outputs.repository-name }} ${{ steps.short_sha.outputs.sha_short }} -mongodb - path: | + path: | mongodb/build/libs/*.jar From b7c008a604b18222950d490ca675adff8040f137 Mon Sep 17 00:00:00 2001 From: DuoDuoJuZi <105411098+DuoDuoJuZi@users.noreply.github.com> Date: Mon, 23 Dec 2024 23:01:41 +0800 Subject: [PATCH 3/5] feat: github packages and set jdk to graalvm21 --- build.gradle.kts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index f1ad7fb..008c331 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,6 +4,7 @@ fun properties(key: String) = project.findProperty(key).toString() group = properties("group") version = properties("version") +val modules = rootProject.subprojects.map { it.name } plugins { // Java plugin @@ -23,6 +24,9 @@ plugins { // Lombok id("io.freefair.lombok") version "8.11" apply false + + // Maven publish + id("maven-publish") } subprojects { @@ -89,4 +93,27 @@ subprojects { relocate("io.github.retrooper.packetevents", "io.fairyproject.libs.packetevents") relocate("io.fairyproject.bukkit.menu", "${properties("package")}.fairy.menu") } -} \ No newline at end of file +} + +publishing { + publications { + modules.forEach { module -> + create("maven-${module.capitalize()}") { + from(components["java"]) + groupId = group.toString() + artifactId = "$module" + version = version + } + } + } + // GitHub Packages + repositories { + maven { + url = uri("https://maven.pkg.github.com/DuoDuoJuZi/Legacy") + credentials { + username = project.findProperty("githubUsername")?.toString() ?: System.getenv("GITHUB_USERNAME")?.toString() ?: error("GitHub username is missing") + password = project.findProperty("githubToken")?.toString() ?: System.getenv("GITHUB_TOKEN")?.toString() ?: error("GitHub token is missing") + } + } + } +} From b933134d8b226be1d0f451462a527ad95e90a675 Mon Sep 17 00:00:00 2001 From: DuoDuoJuZi <105411098+DuoDuoJuZi@users.noreply.github.com> Date: Tue, 24 Dec 2024 12:06:05 +0800 Subject: [PATCH 4/5] fix: graalvm --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67fda73..d0a2501 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,11 +13,10 @@ jobs: uses: actions/checkout@v3 - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: graalvm/setup-graalvm@v1 with: - java-version: 21 + java-version: '21' distribution: 'graalvm' - cache: 'gradle' - name: Make gradlew executable run: chmod +x gradlew From 3a3b86459b055d987d7e8eaa67bb30cfd2f6edc1 Mon Sep 17 00:00:00 2001 From: DuoDuoJuZi <105411098+DuoDuoJuZi@users.noreply.github.com> Date: Tue, 24 Dec 2024 12:18:39 +0800 Subject: [PATCH 5/5] fix: repositories url --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 008c331..5ee162c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -109,7 +109,7 @@ publishing { // GitHub Packages repositories { maven { - url = uri("https://maven.pkg.github.com/DuoDuoJuZi/Legacy") + url = uri("https://maven.pkg.github.com/LegacyLands/legacy-lands-library") credentials { username = project.findProperty("githubUsername")?.toString() ?: System.getenv("GITHUB_USERNAME")?.toString() ?: error("GitHub username is missing") password = project.findProperty("githubToken")?.toString() ?: System.getenv("GITHUB_TOKEN")?.toString() ?: error("GitHub token is missing")