Release artifacts are signed. This is handled by the GitHub workflow.
To test the creation of signed artifacts on the local machine, follow steps below:
VERSION_NAME in gradle.properties so that it does not end with -SNAPSHOT. Whenever the version ends with -SNAPSHOT, the artifacts are never signed. Make sure that this change is not committed.gpg --full-gen-key
pub rsa4096 2023-10-08 [SC] 5B0ABB03277D2FEB46FE7E8E22D6006063A5D3C3 uid ktlint-test (Test signing of ktlint artifacts on local machine only) <ktlint-test@nowhere.com> sub rsa4096 2023-10-08 [E]
export ORG_GRADLE_PROJECT_signingInMemoryKeyId="63A5D3C3" # Last 8 characters of full id of the public key generated by gpg command above export ORG_GRADLE_PROJECT_signingInMemoryKeyPassword="i-will-try-no-to-forget-this-passphrase" # Command below will export the armored GPG signing key and store it in an environment variable. Note that this command will ask for the password (see ORG_GRADLE_PROJECT_signingKeyPassword). export ORG_GRADLE_PROJECT_signingInMemoryKey="$(gpg --export-secret-keys --armor $ORG_GRADLE_PROJECT_signingInMemoryKeyId | tail -r | tail -n +3 | tail -r | tail -n +3 | tr -d '\n')"
./gradlew publishToMavenLocal