Skip to content

Commit 7793fff

Browse files
committed
move signing into sub project
1 parent 4017844 commit 7793fff

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

.github/workflows/hndrs-gradle-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
push:
66
tags:
77
- v*
8+
branches:
9+
- main
810

911
# Allows you to run this workflow manually from the Actions tab
1012
workflow_dispatch:

build.gradle.kts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,6 @@ subprojects {
131131
}
132132
}
133133
}
134-
135-
val signingKey: String? = System.getenv("SIGNING_KEY")
136-
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
137-
if (signingKey != null && signingPassword != null) {
138-
signing {
139-
useInMemoryPgpKeys(groovy.json.StringEscapeUtils.unescapeJava(signingKey), signingPassword)
140-
sign(publications[project.name])
141-
}
142-
}
143134
}
144135
}
145136

spring-json-api-starter/build.gradle.kts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies {
99
publishingInfo {
1010
description = "SpringBoot json api response starter"
1111
}
12-
publishing{
12+
publishing {
1313
val sourcesJarSubProject by tasks.creating(Jar::class) {
1414
dependsOn("classes")
1515
archiveClassifier.set("sources")
@@ -28,5 +28,13 @@ publishing{
2828

2929
}
3030
}
31+
val signingKey: String? = System.getenv("SIGNING_KEY")
32+
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
33+
if (signingKey != null && signingPassword != null) {
34+
signing {
35+
useInMemoryPgpKeys(groovy.json.StringEscapeUtils.unescapeJava(signingKey), signingPassword)
36+
sign(publications[project.name])
37+
}
38+
}
3139
}
3240
}

spring-json-api/build.gradle.kts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ publishing{
1313
archiveClassifier.set("sources")
1414
from(sourceSets["main"].allSource)
1515
}
16-
16+
1717
publications {
18+
println("Pub ${project.name}")
1819
create<MavenPublication>(project.name) {
1920
from(components["java"])
2021
artifact(sourcesJarSubProject)
@@ -26,5 +27,13 @@ publishing{
2627

2728
}
2829
}
30+
val signingKey: String? = System.getenv("SIGNING_KEY")
31+
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
32+
if (signingKey != null && signingPassword != null) {
33+
signing {
34+
useInMemoryPgpKeys(groovy.json.StringEscapeUtils.unescapeJava(signingKey), signingPassword)
35+
sign(publications[project.name])
36+
}
37+
}
2938
}
3039
}

0 commit comments

Comments
 (0)