Skip to content

Document both file-based and in-memory GPG signing for publishing#9

Merged
perNyfelt merged 3 commits intosecurity_dependenciesfrom
copilot/sub-pr-8
Dec 16, 2025
Merged

Document both file-based and in-memory GPG signing for publishing#9
perNyfelt merged 3 commits intosecurity_dependenciesfrom
copilot/sub-pr-8

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

The PUBLISHING.md documentation showed inconsistency between GPG Key Setup (file-based secretKeyRingFile) and CI/CD Integration (in-memory signingKey).

Changes

  • GPG Key Setup: Split into file-based (traditional) and in-memory (CI/CD) subsections with export instructions for each approach
  • Configure Credentials: Restructured as Option A (file-based for local) and Option B (in-memory for CI/CD) with complete environment variable examples
  • CI/CD Setup: Explicitly recommend in-memory signing, clarify required GitHub secrets, add note on avoiding temporary key files on runners

Both approaches now documented with clear use cases:

# File-based (local development)
signing.secretKeyRingFile=/path/to/.gnupg/secring.gpg

# In-memory (CI/CD)
export ORG_GRADLE_PROJECT_signingKey="$(cat private-key.asc)"

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ISHING.md

Co-authored-by: perNyfelt <13261538+perNyfelt@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on security and dependencies updates Document both file-based and in-memory GPG signing for publishing Dec 16, 2025
Copilot AI requested a review from perNyfelt December 16, 2025 23:00
@perNyfelt perNyfelt marked this pull request as ready for review December 16, 2025 23:06
Copilot AI review requested due to automatic review settings December 16, 2025 23:06
@perNyfelt perNyfelt merged commit 28e4b6b into security_dependencies Dec 16, 2025
@perNyfelt perNyfelt deleted the copilot/sub-pr-8 branch December 16, 2025 23:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the PUBLISHING.md documentation by clearly differentiating between file-based and in-memory GPG signing approaches, addressing previous inconsistencies in the documentation. The changes provide comprehensive guidance for both local development (file-based) and CI/CD environments (in-memory signing).

Key Changes:

  • Split GPG Key Setup into file-based (traditional) and in-memory (CI/CD) subsections with specific export instructions for each
  • Restructured environment variable configuration with clear examples for both in-memory and file-based approaches
  • Enhanced CI/CD section to explicitly recommend in-memory signing and clarify required GitHub secrets

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Use this approach for local development:

# Export your secret key ring (legacy approach for GPG < 2.1)
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing opening code fence. The code block needs to start with three backticks (```) before the bash commands to properly format the code block.

Copilot uses AI. Check for mistakes.
export ORG_GRADLE_PROJECT_signingKey="$(cat private-key.asc)"
```

Alternatively, for file-based signing in CI/CD:
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The section title "Alternatively, for file-based signing in CI/CD:" is misleading. Looking at lines 114-118, this section actually shows the in-memory signing approach (using signingKey with GPG_PRIVATE_KEY_SECRET), not file-based signing. The only file-based option shown is the "Alternative" on line 123 which uses signingSecretKeyRingFile. Consider revising this section title to accurately reflect that it shows an alternative way to provide the in-memory key (from a secret variable) versus the recommended approach on line 108 which reads from a file.

Copilot uses AI. Check for mistakes.
run: ./gradlew publish
```

**Note:** The `signingKey` property uses the in-memory approach, which avoids creating temporary key files on CI runners. The base64-encoded key from `GPG_SIGNING_KEY` is decoded automatically by Gradle.
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The statement "The base64-encoded key from GPG_SIGNING_KEY is decoded automatically by Gradle" is inaccurate. According to the earlier documentation (line 234), GPG_SIGNING_KEY should contain the ASCII-armored private key from "gpg --armor --export-secret-keys", not a base64-encoded key. ASCII-armored format is already a base64-like encoding but in PGP's specific format. Gradle's signing plugin expects the ASCII-armored format directly, not an additional base64 encoding. This note should be corrected to avoid confusion about the expected key format.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants