From f14e88ab7ac6750cfa1cd84d752e2df8187dd526 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Sun, 3 Nov 2024 17:22:10 +0900 Subject: [PATCH] super experimental changes --- .github/workflows/gradle.yml | 6 +++--- .github/workflows/release.yml | 15 ++++++++++---- build.gradle.kts | 35 ++++++++++++++++++++++++--------- gradle.properties | 37 ++++++++++++++++++++++++++--------- gradle/libs.versions.toml | 10 ++++++---- 5 files changed, 74 insertions(+), 29 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 4701c19a6..9c1d33e95 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 24949fc60..08177a3bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,17 +70,24 @@ 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/') + env: + 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 }} run: | - export GITHUB_USERNAME=${{ env.ORG_NAME }} - export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} ./gradlew publish --stacktrace - name: Update Sources diff --git a/build.gradle.kts b/build.gradle.kts index 4696eb2e7..8c72c3c10 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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) } @@ -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 { @@ -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() } } } @@ -51,10 +60,7 @@ subprojects { withType().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 { @@ -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("") +} diff --git a/gradle.properties b/gradle.properties index 397c90312..96f7accc4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 @@ -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 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 14a5b6040..37021e3e5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" }