Implement conditional GPG signing in CI builds to preserve validation while handling missing secrets - #8
Conversation
Co-authored-by: nathanfunk <3503769+nathanfunk@users.noreply.github.com>
nathanfunk
left a comment
There was a problem hiding this comment.
I don't want to just skip the javadoc and gpg signing. It is important that these are both run after every merge to master to ensure no issues are introduced.
|
@copilot I don't want to just skip the javadoc and gpg signing. It is important that these are both run after every merge to master to ensure no issues are introduced. |
Co-authored-by: nathanfunk <3503769+nathanfunk@users.noreply.github.com>
I've updated the solution to address your requirements. Instead of always skipping GPG and JavaDoc, the CI workflow now uses conditional logic:
This ensures both GPG signing and JavaDoc are validated in CI builds whenever possible, while gracefully handling cases where GPG keys aren't available. All 202 tests pass and JavaDoc artifacts are successfully generated. The workflow now uses the same modern actions and GPG configuration as your release workflow for consistency. Commit: 2d18e4a |
The Maven CI build was failing with
gpg: signing failed: No secret keybecause the workflow was attempting to sign artifacts without proper GPG key configuration. Rather than simply skipping GPG and JavaDoc generation, this implements a conditional approach that preserves validation when possible.Problem
The
pom.xmlcontains themaven-gpg-pluginconfigured to run during the verify phase for all builds, but regular CI builds don't have access to the GPG secrets that are properly configured for releases.Solution
Updated the CI workflow with conditional logic to handle GPG keys intelligently:
mvn clean installwith both GPG signing and JavaDoc generationmvn clean install -Dgpg.skip=truebut still generates JavaDocBenefits
setup-java@v3,checkout@v4) with proper cachingThis approach ensures maximum validation coverage while gracefully handling the security constraints of fork-based contributions.
Fixes #7.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.