Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed Nov 3, 2024
0 parents commit 6463eb2
Show file tree
Hide file tree
Showing 11 changed files with 903 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release Plazmaclip

on:
push:
workflow_dispatch:

jobs:
release:
name: Release Plazma
strategy:
matrix:
base_jdk: [21]
os: [ubuntu-22.04]

if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
runs-on: ${{ matrix.os }}
steps:

- name: Checkout repository
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4

- name: Set up GraalVM ${{ matrix.base_jdk }}
uses: graalvm/setup-graalvm@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
java-version: ${{ matrix.base_jdk }}
version: latest
cache: 'gradle'

- name: Configure Git
run: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config --global user.name "github-actions[bot]"

- name: Publish Packages
if: ${{ github.ref_name == 'master' }}
run: |
export GITHUB_USERNAME=${{ github.repository_owner }}
./gradlew publish --info --stacktrace
45 changes: 45 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Kotlin ###
.kotlin

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
107 changes: 107 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
plugins {
java
signing
`maven-publish`
id("com.gradleup.shadow") version "8.3.4" apply false
id("net.minecraftforge.gradlejarsigner") version "1.0.5"
}

repositories {
mavenCentral()
}

subprojects {
tasks.register<Jar>("sourcesJar") {
from(zipTree(tasks.jar.map { it.outputs.files.singleFile }))
archiveClassifier.set("sources")
}
}

tasks {
jar {
jarSigner.sign(jar.get())

val app = project(":kotlin").tasks.named("shadowJar")
dependsOn(app)

from(zipTree(app.map { it.outputs.files.singleFile }))
manifest { attributes("Main-Class" to "plazmaclip.PlazmaclipKt") }

rename { if (it.endsWith("-LICENSE.txt")) "META-INF/license/$it" else it }
}

register<Jar>("sourcesJar") {
val app = project(":kotlin").tasks.named("sourcesJar")
dependsOn(app)

from(zipTree(app.map { it.outputs.files.singleFile }))
archiveClassifier.set("sources")
}
}

publishing.publications {
repositories.maven("https://maven.pkg.github.com/PlazmaMC/Plazmaclip") {
name = "githubPackage"

credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
}
}

register<MavenPublication>("maven") {
groupId = project.group.toString()
version = project.version.toString()
artifactId = "plazmaclip"

from(components["java"])
artifact(tasks["sourcesJar"])
withoutBuildIdentifier()

pom {
url.set("https://github.com/PlazmaMC/Plazmaclip")
name.set("plazmaclip")
description.set(project.description)
packaging = "jar"

licenses {
license {
name.set("MIT")
url.set("https://github.com/PlazmaMC/Plazmaclip/blob/main/LICENSE.md")
distribution.set("repo")
}
}

issueManagement {
system.set("GitHub")
url.set("https://github.com/PlazmaMC/Plazmaclip/issues")
}

developers {
developer {
id.set("AlphaKR93")
name.set("Alpha")
email.set("dev@alpha93.kr")
url.set("https://alpha93.kr/")
}
}

scm {
url.set("https://github.com/PlazmaMC/Plazmaclip")
connection.set("scm:git:https://github.com/PlazmaMC/Plazmaclip.git")
developerConnection.set("scm:git:git@github.com:https://github.com/PlazmaMC/Plazmaclip.git")
}
}
}
}

signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["maven"])
}

jarSigner {
autoDetect("")
}
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
group = org.plazmamc
version = 1.0.0-SNAPSHOT
description = Launcher for the Plazma Minecraft Server

kotlin.code.style = official
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sat Nov 02 19:02:21 KST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 6463eb2

Please sign in to comment.