Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
QwQ-dev committed Dec 24, 2024
2 parents bfd4f56 + 3a3b864 commit e79fcce
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 12 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Java JDK
uses: actions/setup-java@v3
uses: graalvm/setup-graalvm@v1
with:
java-version: 21
distribution: 'zulu'
cache: 'gradle'

java-version: '21'
distribution: 'graalvm'

- name: Make gradlew executable
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew shadowJar

Expand All @@ -32,6 +31,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 +44,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/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")
}
}
}
}
1 change: 1 addition & 0 deletions legacy-lands-library
Submodule legacy-lands-library added at 80a0d4

0 comments on commit e79fcce

Please sign in to comment.