From 47ff3144d969a497714593e92980ee70e2bbb3cf Mon Sep 17 00:00:00 2001 From: Ryan Dens Date: Thu, 12 Dec 2024 11:34:35 -0800 Subject: [PATCH] :sparkles: publish a single zip with signatures and MD5s that can be directly published on central.sonatype.com --- .github/workflows/publish.yml | 4 ++-- build.gradle.kts | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 916e2be..e5036f0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,7 +25,7 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Execute Gradle build - run: ./gradlew -Pversion=${{ inputs.version }} build publishToMavenLocal + run: ./gradlew -Pversion=${{ inputs.version }} build zipRelease env: ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }} @@ -38,4 +38,4 @@ jobs: automatic_release_tag: "${{ inputs.version }}" prerelease: false files: | - /home/runner/.m2/repository/io/github/pixee/java-security-toolkit/${{ inputs.version }}/* + build/distributions/java-security-toolkit.zip diff --git a/build.gradle.kts b/build.gradle.kts index 4564a75..75e6c95 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -145,6 +145,23 @@ publishing { } } } + + repositories { + maven { + name = "build" + url = uri(layout.buildDirectory.dir("repos/releases")) + } + } +} + + +tasks.register("zipRelease") { + dependsOn("publishAllPublicationsToBuildRepository") + from(layout.buildDirectory.dir("repos/releases")) { + exclude("**/maven-metadata.xml") + exclude("**/maven-metadata.xml*") + } + archiveFileName.set("java-security-toolkit.zip") } tasks.jacocoTestReport {