Skip to content

Commit

Permalink
Merge pull request #49 from Johannestegner/feature/gpg-signing
Browse files Browse the repository at this point in the history
Added gpg signing to gradle build.
  • Loading branch information
Johannestegner authored Dec 30, 2024
2 parents b330f9b + 0ef20df commit f4133b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ jobs:
- name: Publish to GitHub Packages
run: gradle publish
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'maven-publish'
id 'java'
id 'java-library'
id 'signing'
}

group 'dev.organisationsnummer'
Expand Down Expand Up @@ -91,3 +92,15 @@ publishing {
}
}
}

signing {
def signingKeyId = "C5D41C23" // Short format key-id of signing key.
def signingKey = findProperty("signingKey") ?: "key"
def signingPassword = findProperty("signingPassword") ?: "pass"
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications.mavenJava
}

tasks.withType(Sign) {
onlyIf { version != "NONE" }
}

0 comments on commit f4133b9

Please sign in to comment.