diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2630980a3b..3ceea3d7cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,3 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} CHANGELOG: ${{ steps.changelog.outputs.changelog }} - SIGNING_SERVER: ${{ secrets.SIGNING_SERVER }} - SIGNING_PGP_KEY: ${{ secrets.SIGNING_PGP_KEY }} - SIGNING_JAR_KEY: ${{ secrets.SIGNING_JAR_KEY }} diff --git a/build.gradle b/build.gradle index 478741efa3..3c5d14ed21 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,7 @@ plugins { id "org.quiltmc.loom" version "1.7.3" apply false id "com.diffplug.spotless" version "6.20.0" id "org.ajoberstar.grgit" version "3.1.0" + id "me.modmuss50.remotesign" version "0.4.0" apply false id "me.modmuss50.mod-publish-plugin" version "0.4.5" } @@ -128,11 +129,25 @@ allprojects { group = "org.quiltmc.quilted-fabric-api" apply plugin: "maven-publish" + apply plugin: "me.modmuss50.remotesign" tasks.withType(GenerateModuleMetadata) { enabled = false } + remoteSign { + requestUrl = ENV.SIGNING_SERVER + pgpAuthKey = ENV.SIGNING_PGP_KEY + jarAuthKey = ENV.SIGNING_JAR_KEY + + useDummyForTesting = ENV.SIGNING_SERVER == null + + afterEvaluate { + // PGP sign all maven publications. + sign publishing.publications.mavenJava + } + } + publishing { setupRepositories(repositories) } @@ -287,6 +302,10 @@ allprojects { reproducibleFileOrder = true } + remoteSign { + sign remapJar + } + // Run this task after updating minecraft to regenerate any required resources tasks.register('generateResources') { group = "fabric" @@ -623,8 +642,8 @@ subprojects { pom { addPomMetadataInformation(project, pom) } - artifact(remapJar.output) { - builtBy(remapJar) + artifact(signRemapJar.output) { + builtBy(signRemapJar) } artifact(remapSourcesJar) { @@ -643,8 +662,8 @@ subprojects { publishing { publications { mavenJava(MavenPublication) { - artifact(remapJar.output) { - builtBy(remapJar) + artifact(signRemapJar.output) { + builtBy(signRemapJar) } artifact(sourcesJar) { @@ -767,13 +786,14 @@ remapJar { return } - nestedJars.from project("${it.path}").tasks.getByName("remapJar") + // Include the signed or none signed jar from the sub project. + nestedJars.from project("${it.path}").tasks.getByName("signRemapJar") } } } publishMods { - file = remapJar.output + file = signRemapJar.output changelog = "Provides Fabric API ${project.upstream_version}\n" + providers.environmentVariable("CHANGELOG").getOrElse("No changelog provided") type = project.prerelease == "true" ? BETA : STABLE displayName = "[$project.minecraft_version] QFAPI " + project.version.split('\\+')[0] + " and QSL " + project.qsl_version.split('\\+')[0] @@ -797,7 +817,7 @@ publishMods { } } - +assemble.dependsOn signRemapJar import java.util.stream.Collectors