Skip to content

Commit

Permalink
Merge pull request #3 from DuoDuoJuZi/duoduojuzi-dev
Browse files Browse the repository at this point in the history
Duoduojuzi dev
  • Loading branch information
QwQ-dev authored Dec 24, 2024
2 parents 80a0d4a + b7c008a commit d7dc78d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -32,6 +32,11 @@ jobs:
- name: Get Repository Name
uses: MariachiBear/[email protected]

- name: Publish to GitHub Packages
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/[email protected]
with:
name: ${{ steps.repo-name.outputs.repository-name }} ${{ steps.short_sha.outputs.sha_short }} -annotation
Expand All @@ -40,20 +45,20 @@ jobs:
- uses: actions/[email protected]
with:
name: ${{ steps.repo-name.outputs.repository-name }} ${{ steps.short_sha.outputs.sha_short }} -cache
path: |
path: |
cache/build/libs/*.jar
- uses: actions/[email protected]
with:
name: ${{ steps.repo-name.outputs.repository-name }} ${{ steps.short_sha.outputs.sha_short }} -configuration
path: |
path: |
configuration/build/libs/*.jar
- uses: actions/[email protected]
with:
name: ${{ steps.repo-name.outputs.repository-name }} ${{ steps.short_sha.outputs.sha_short }} -commons
path: |
path: |
commons/build/libs/*.jar
- uses: actions/[email protected]
with:
name: ${{ steps.repo-name.outputs.repository-name }} ${{ steps.short_sha.outputs.sha_short }} -mongodb
path: |
path: |
mongodb/build/libs/*.jar
29 changes: 28 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,6 +24,9 @@ plugins {

// Lombok
id("io.freefair.lombok") version "8.11" apply false

// Maven publish
id("maven-publish")
}

subprojects {
Expand Down Expand Up @@ -89,4 +93,27 @@ subprojects {
relocate("io.github.retrooper.packetevents", "io.fairyproject.libs.packetevents")
relocate("io.fairyproject.bukkit.menu", "${properties("package")}.fairy.menu")
}
}
}

publishing {
publications {
modules.forEach { module ->
create<MavenPublication>("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")
}
}
}
}
1 change: 1 addition & 0 deletions legacy-lands-library
Submodule legacy-lands-library added at 80a0d4

0 comments on commit d7dc78d

Please sign in to comment.