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..e8341ab50 100644 --- a/.github/workflows/ci-gradle.yml +++ b/.github/workflows/ci-gradle.yml @@ -119,28 +119,13 @@ jobs: generateMetadataFileForMavenPublication generatePomFileForMavenPublication \ -x test - - name: Setup gpg - if: env.ARTIFACT_SIGNING_KEY - id: gpg - env: - ARTIFACT_SIGNING_KEY: ${{ secrets.ARTIFACT_SIGNING_KEY }} - run: | - echo "Importing key ..." - echo "${ARTIFACT_SIGNING_KEY}" | gpg --batch --import --import-options import-show - - echo "Getting key id ..." - key_id="$(echo "${ARTIFACT_SIGNING_KEY}" | gpg --batch --show-keys --with-colons | awk -F: '$1 == "sec" { print $5 }')" - echo "::set-output name=key_id::${key_id}" - - name: Sign artifacts - if: env.GPG_KEYNAME + if: env.ORG_GRADLE_PROJECT_signingKey env: - GPG_KEYNAME: ${{ steps.gpg.outputs.key_id }} - GPG_PASSPHRASE: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }} + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ARTIFACT_SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }} run: | - gradle sign \ - "-Psigning.gnupg.keyName=${GPG_KEYNAME}" \ - "-Psigning.gnupg.passphrase=${GPG_PASSPHRASE}" + gradle -q signMavenPublication signPdfJar - name: Upload artifacts uses: actions/upload-artifact@v2 diff --git a/build.gradle.kts b/build.gradle.kts index e5f7a5f43..05691bc39 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,7 +28,7 @@ dependencies { testImplementation("org.assertj:assertj-core:3.22.0") testImplementation("org.junit.jupiter:junit-jupiter:5.8.2") testImplementation("org.scilab.forge:jlatexmath:1.0.7") - "pdfRuntimeOnly"("org.apache.xmlgraphics:fop:2.6") + "pdfRuntimeOnly"("org.apache.xmlgraphics:fop:2.7") "pdfRuntimeOnly"("org.apache.xmlgraphics:batik-all:1.14") } @@ -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,17 @@ tasks.create("pdfJar", Jar::class) { with(tasks.jar.get()) archiveAppendix.set("pdf") } + +signing { + if (hasProperty("signing.gnupg.keyName") && hasProperty("signing.gnupg.passphrase")) { + useGpgCmd() + } else if (hasProperty("signingKey") && hasProperty("signingPassword")) { + val signingKey: String? by project + val signingPassword: String? by project + useInMemoryPgpKeys(signingKey, signingPassword) + } + if (hasProperty("signing.gnupg.passphrase") || hasProperty("signingPassword")) { + sign(publishing.publications["maven"]) + sign(closureOf { sign(pdfJar.get()) }) + } +} diff --git a/pom.xml b/pom.xml index c64537037..f39cf1fe6 100644 --- a/pom.xml +++ b/pom.xml @@ -226,7 +226,7 @@ org.codehaus.mojo versions-maven-plugin - 2.8.1 + 2.9.0 @@ -289,7 +289,7 @@ org.apache.xmlgraphics fop - 2.6 + 2.7 org.apache.xmlgraphics