Andrew O'Hara
07/12/2024, 4:12 PMsignMavenPublication
task is due to the plugin itself, or the underlying signing
plugin. The signing plugin gives instructions to provide your GPG keys using a system keychain (not feasible in CI), but the gradle-maven-publish-plugin
provides instructions to use an in-memory key via ENV. I've set the following variables in my CI:
• ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD
• ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME
• ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY
• ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD
• ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID (optional)
Where the maven central credentials are from a generated user token (since I signed in to central with Github)
and my gradle file is configure like so:
mavenPublishing {
configure(KotlinJvm(sourcesJar = true))
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
signAllPublications()
coordinates("dev.andrewohara", "service-utils", "1.20.0")
pom {
...
}
}
However, after running
$ sh ./gradlew publish --no-configuration-cache
I get
Execution failed for task ':signMavenPublication'.
> Cannot perform signing task ':signMavenPublication' because it has no configured signatory
Common suggestions I've seen point to a missing variable, but I think I have them all. Does anyone have any advice?ephemient
07/12/2024, 4:18 PMAndrew O'Hara
07/12/2024, 4:20 PMephemient
07/12/2024, 4:21 PMAndrew O'Hara
07/12/2024, 4:24 PMAndrew O'Hara
07/12/2024, 4:24 PMephemient
07/12/2024, 4:25 PMephemient
07/12/2024, 4:27 PMjobs:
publish:
steps:
- run: |
./gradlew publish
env:
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
Andrew O'Hara
07/12/2024, 4:28 PMAndrew O'Hara
07/12/2024, 4:55 PM