Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plazmaclip & Jar Signing #103

Draft
wants to merge 2 commits into
base: ver/1.21.3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout action
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Set up JDK ${{ matrix.java }} ${{ matrix.jdk }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.java }}
java-version: ${{ matrix.jdk }}
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ on:
workflow_dispatch:

env:
ORG_NAME: PlazmaMC
ORG_GRADLE_PROJECT_ghName: ${{ github.repository_owner }}
ORG_GRADLE_PROJECT_ghToken: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGN_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGN_PASSWORD }}
SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }}
SIGN_KEYSTORE_DATA: ${{ secrets.SIGN_KEYSTORE_DATA }}
SIGN_KEYSTORE_PASSWORD: ${{ secrets.SIGN_KEYSTORE_PASSWORD }}

jobs:
release:
Expand Down Expand Up @@ -70,17 +77,15 @@ jobs:
- name: Build
run: ./gradlew build --stacktrace

- name: Create Reobf Jar
- name: Create Re-obfuscated Jar
run: ./gradlew createReobfPaperclipJar --stacktrace

- name: Create Mojmap Jar
- name: Create Mojang mapped Jar
run: ./gradlew createMojmapPaperclipJar --stacktrace

- name: Publish Packages
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/')
run: |
export GITHUB_USERNAME=${{ env.ORG_NAME }}
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
./gradlew publish --stacktrace

- name: Update Sources
Expand Down
35 changes: 26 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent

plugins {
java
`maven-publish`
signing
`kotlin-dsl`
`maven-publish`
`always-up-to-date`
alias(libs.plugins.shadow) apply false
alias(libs.plugins.jarsigner)
alias(libs.plugins.paperweight)
}

Expand All @@ -21,12 +23,20 @@ repositories {
maven("https://repo.papermc.io/repository/maven-public/") {
content { onlyForConfigurations(configurations.paperclip.name) }
}
maven("https://maven.pkg.github.com/PlazmaMC/Plazmaclip") {
name = "githubPackage"

credentials {
username = property("ghName").toString()
password = property("ghToken").toString()
}
}
}

dependencies {
remapper(libs.remapper)
paperclip(libs.plazmaclip)
decompiler(libs.decompiler)
paperclip(libs.paperclip)
}

allprojects {
Expand All @@ -37,11 +47,10 @@ allprojects {

publishing.repositories.maven("https://maven.pkg.github.com/$providerRepo") {
name = "githubPackage"
url = uri("https://maven.pkg.github.com/$providerRepo")

credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
username = property("ghName").toString()
password = property("ghToken").toString()
}
}
}
Expand All @@ -51,10 +60,7 @@ subprojects {
withType<JavaCompile>().configureEach {
options.encoding = Charsets.UTF_8.name()
options.release = jdkVersion
options.compilerArgs.addAll(listOf(
"--add-modules=jdk.incubator.vector",
"-Xmaxwarns", "1"
))
options.compilerArgs.addAll(listOf("--add-modules=jdk.incubator.vector"))
}

withType<Javadoc> {
Expand Down Expand Up @@ -171,3 +177,14 @@ publishing {
artifact(tasks.generateDevelopmentBundle) { artifactId = "dev-bundle" }
}
}

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

jarSigner {
autoDetect("")
}
37 changes: 28 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
org.gradle.daemon = true
org.gradle.caching = true
org.gradle.parallel = true
org.gradle.vfs.watch = false
org.gradle.jvmargs = -Xmx4G -Dfile.encoding=UTF-8 -Dgraal.CompilerConfiguration=community -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true -Dgraal.SpeculativeGuardMovement=true -Dgraal.WriteableCodeCache=true

paper.runMemoryGb = 8
paper.runDisableWatchdog = true

group = org.plazmamc.plazma
brandKey = plazmamc:plazma
brandName = Plazma
providerName = PlazmaMC
providerRepo = PlazmaMC/PlazmaBukkit

########################################################################################################################

paper.runMemoryGb = 8
paper.runDisableWatchdog = true

version = 1.21.3-R0.1-SNAPSHOT
mcVersion = 1.21.3
jdkVersion = 21
Expand All @@ -25,5 +21,28 @@ pufferfishRepo = https://github.com/pufferfish-gg/Pufferfish
pufferfishBranch = ver/1.21
usePufferfish = false

# DO NOT EDIT BELOW; USE ALWAYS-UP-TO-DATE INSTEAD
paperCommit = 92131adaf2687f350b2f8dc7cd1213ab833d1831
purpurCommit = c6802b0a27f1f8faac4ad30f902810fd0ed8051e

########################################################################################################################

org.gradle.caching = true
org.gradle.console = auto
org.gradle.continue = true
org.gradle.daemon = false
org.gradle.daemon.idletimeout = 10800000
org.gradle.parallel = true
org.gradle.vfs.watch = false

# Experimental Options
org.gradle.configuration-cache = false
org.gradle.configureondemand = false
org.gradle.unsafe.isolated-projects = false

# Debug Options
org.gradle.debug = false
org.gradle.caching.debug = false
org.gradle.logging.level = lifecycle
org.gradle.warning.mode = summary
org.gradle.jvmargs = -Xmx4G -Dfile.encoding=UTF-8 -Dgraal.CompilerConfiguration=community -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true -Dgraal.SpeculativeGuardMovement=true -Dgraal.WriteableCodeCache=true
10 changes: 6 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
[versions]
shadow = "8.1.1"
paperweight = "1.7.4"
paperclip = "3.0.3"
decompiler = "1.10.1"
remapper = "0.10.3"
jarsigner = "1.0.5"
plazmaclip = "1.0.0-SNAPSHOT"
decompiler = "1.10.1"
paperweight = "1.7.4"

[libraries]
remapper = { group = "net.fabricmc", name = "tiny-remapper", version.ref="remapper" }
plazmaclip = { group = "org.plazmamc", name = "plazmaclip", version.ref = "plazmaclip" }
decompiler = { group = "org.vineflower", name = "vineflower", version.ref = "decompiler" }
paperclip = { group = "io.papermc", name = "paperclip", version.ref = "paperclip" }

[plugins]
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
jarsigner = { id = "net.minecraftforge.gradlejarsigner", version.ref = "jarsigner" }
paperweight = { id = "io.papermc.paperweight.patcher", version.ref = "paperweight" }