Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): set up signing at root project level #1435

Merged
merged 1 commit into from
Feb 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@ def addCloudExtensionDependency(proj) {
proj.dependencies { compile project(":extensions:cloud:portability-cloud-${proj.rootProject.ext.cloudType}") }
}

def configureSigning(Project project) {
if (project.hasProperty("signing.keyId")) {
project.signing {
sign project.configurations.archives
}
} else if (System.getenv("GRADLE_SIGNING_KEY")) {
// For use in CI
project.signing {
def signingKey = System.getenv('GRADLE_SIGNING_KEY')
def signingPassword = System.getenv('GRADLE_SIGNING_PASSWORD')
useInMemoryPgpKeys(signingKey, signingPassword)
sign project.configurations.archives
}
}
}
configureSigning(project)

/**
* Configures the project to publish Maven artifacts to Maven Central.
*/
Expand All @@ -123,6 +140,7 @@ def configurePublication(Project project) {
archives project.javadocJar, project.sourcesJar
}

configureSigning(project)

// Configure artifact publication
project.uploadArchives {
Expand Down Expand Up @@ -175,20 +193,6 @@ def configurePublication(Project project) {
}
}
}

if (project.hasProperty("signing.keyId")) {
project.signing {
sign project.configurations.archives
}
} else if (System.getenv("GRADLE_SIGNING_KEY")) {
// For use in CI
project.signing {
def signingKey = System.getenv('GRADLE_SIGNING_KEY')
def signingPassword = System.getenv('GRADLE_SIGNING_PASSWORD')
useInMemoryPgpKeys(signingKey, signingPassword)
sign project.configurations.archives
}
}
}


Expand Down
Loading