Skip to content

Commit

Permalink
TeamCity: configure signing
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Obexer <[email protected]>
  • Loading branch information
cobexer committed Sep 10, 2024
1 parent 918acf7 commit 51f06e1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .teamcity/src/main/kotlin/Publish.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ class Publish(build: Build, tests: TestTrigger) : BaseBuildType({
param("env.GRADLE_INTERNAL_REPO_URL", "%gradle.internal.repository.url%")
param("ARTIFACTORY_USERNAME", "%gradle.internal.repository.build-tool.publish.username%")
password("ARTIFACTORY_PASSWORD", "%gradle.internal.repository.build-tool.publish.password%", display = ParameterDisplay.HIDDEN)
param("env.ORG_GRADLE_PROJECT_publishApiKey", "%ARTIFACTORY_PASSWORD%")
password("env.ORG_GRADLE_PROJECT_publishApiKey", "%ARTIFACTORY_PASSWORD%")
param("env.ORG_GRADLE_PROJECT_publishUserName", "%ARTIFACTORY_USERNAME%")
param("env.PGP_SIGNING_KEY", "%pgpSigningKey%")
password("env.PGP_SIGNING_KEY_PASSPHRASE", "%pgpSigningPassphrase%")
}

steps {
Expand Down
13 changes: 13 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
id("maven-publish")
id("gradlebuild.git-version")
id("gradlebuild.zig")
id("signing")
}

group = "org.gradle.fileevents"
Expand Down Expand Up @@ -198,3 +199,15 @@ publishing {
}
}
}

signing {
useInMemoryPgpKeys(
System.getenv("PGP_SIGNING_KEY"),
System.getenv("PGP_SIGNING_KEY_PASSPHRASE")
)
if (!System.getenv("PGP_SIGNING_KEY_PASSPHRASE").isNullOrBlank()) {
publishing.publications.configureEach {
signing.sign(this)
}
}
}

0 comments on commit 51f06e1

Please sign in to comment.