From 2c44343fad25ef0c538f405a9d302a3736747e98 Mon Sep 17 00:00:00 2001 From: soloturn Date: Mon, 14 Feb 2022 10:29:34 +0100 Subject: [PATCH] gradle, sign plantuml-pdf.jar, and gh upload --- .github/scripts/release-gradle-snapshot.sh | 1 + .github/scripts/release-gradle.sh | 1 + .github/workflows/ci-gradle.yml | 2 +- build.gradle.kts | 17 +++++++++-------- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/scripts/release-gradle-snapshot.sh b/.github/scripts/release-gradle-snapshot.sh index 600a92b94..aef91a4a7 100755 --- a/.github/scripts/release-gradle-snapshot.sh +++ b/.github/scripts/release-gradle-snapshot.sh @@ -28,6 +28,7 @@ if [[ -e "build/publications/maven/module.json.asc" ]]; then ln -s "../libs/plantuml-${POM_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT.jar.asc" ln -s "../libs/plantuml-${POM_VERSION}-javadoc.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-javadoc.jar.asc" ln -s "../libs/plantuml-${POM_VERSION}-sources.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-sources.jar.asc" + ln -s "../libs/plantuml-pdf-${POM_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-pdf-SNAPSHOT.jar.asc" fi echo -n "${DATE_TIME_UTC}" > "${RELEASE_DIR}/plantuml-SNAPSHOT.timestamp" diff --git a/.github/scripts/release-gradle.sh b/.github/scripts/release-gradle.sh index bc6fcc3d7..9c4904fc8 100755 --- a/.github/scripts/release-gradle.sh +++ b/.github/scripts/release-gradle.sh @@ -16,6 +16,7 @@ if [[ -e "build/publications/maven/module.json.asc" ]]; then ln -s "../libs/plantuml-${POM_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}.jar.asc" ln -s "../libs/plantuml-${POM_VERSION}-javadoc.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}-javadoc.jar.asc" ln -s "../libs/plantuml-${POM_VERSION}-sources.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}-sources.jar.asc" + ln -s "../libs/plantuml-pdf-${POM_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-pdf-${POM_VERSION}.jar.asc" fi gh release create \ diff --git a/.github/workflows/ci-gradle.yml b/.github/workflows/ci-gradle.yml index d02ef0a31..b1b52487e 100644 --- a/.github/workflows/ci-gradle.yml +++ b/.github/workflows/ci-gradle.yml @@ -138,7 +138,7 @@ jobs: GPG_KEYNAME: ${{ steps.gpg.outputs.key_id }} GPG_PASSPHRASE: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }} run: | - gradle sign \ + gradle -q signMavenPublication signPdfJar \ "-Psigning.gnupg.keyName=${GPG_KEYNAME}" \ "-Psigning.gnupg.passphrase=${GPG_PASSPHRASE}" diff --git a/build.gradle.kts b/build.gradle.kts index e5f7a5f43..958a963d9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -110,14 +110,7 @@ tasks.test { testLogging.showStandardStreams = true } -signing { - if (hasProperty("signing.gnupg.passphrase")) { - useGpgCmd() - sign(publishing.publications["maven"]) - } -} - -tasks.create("pdfJar", Jar::class) { +val pdfJar by tasks.registering(Jar::class) { group = "build" // OR for example, "build" description = "Assembles a jar containing dependencies to create PDFs." manifest.attributes["Main-Class"] = "net.sourceforge.plantuml.Run" @@ -127,3 +120,11 @@ tasks.create("pdfJar", Jar::class) { with(tasks.jar.get()) archiveAppendix.set("pdf") } + +signing { + if (hasProperty("signing.gnupg.passphrase")) { + useGpgCmd() + sign(publishing.publications["maven"]) + sign(closureOf { sign(pdfJar.get()) }) + } +}