Skip to content

Commit

Permalink
move signing into sub project
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinSchramm committed Feb 16, 2021
1 parent 4017844 commit 7793fff
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/hndrs-gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
push:
tags:
- v*
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
9 changes: 0 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,6 @@ subprojects {
}
}
}

val signingKey: String? = System.getenv("SIGNING_KEY")
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
if (signingKey != null && signingPassword != null) {
signing {
useInMemoryPgpKeys(groovy.json.StringEscapeUtils.unescapeJava(signingKey), signingPassword)
sign(publications[project.name])
}
}
}
}

Expand Down
10 changes: 9 additions & 1 deletion spring-json-api-starter/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {
publishingInfo {
description = "SpringBoot json api response starter"
}
publishing{
publishing {
val sourcesJarSubProject by tasks.creating(Jar::class) {
dependsOn("classes")
archiveClassifier.set("sources")
Expand All @@ -28,5 +28,13 @@ publishing{

}
}
val signingKey: String? = System.getenv("SIGNING_KEY")
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
if (signingKey != null && signingPassword != null) {
signing {
useInMemoryPgpKeys(groovy.json.StringEscapeUtils.unescapeJava(signingKey), signingPassword)
sign(publications[project.name])
}
}
}
}
11 changes: 10 additions & 1 deletion spring-json-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ publishing{
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}

publications {
println("Pub ${project.name}")
create<MavenPublication>(project.name) {
from(components["java"])
artifact(sourcesJarSubProject)
Expand All @@ -26,5 +27,13 @@ publishing{

}
}
val signingKey: String? = System.getenv("SIGNING_KEY")
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
if (signingKey != null && signingPassword != null) {
signing {
useInMemoryPgpKeys(groovy.json.StringEscapeUtils.unescapeJava(signingKey), signingPassword)
sign(publications[project.name])
}
}
}
}

0 comments on commit 7793fff

Please sign in to comment.