Skip to content

Commit 800eec4

Browse files
committed
Add signing keys
1 parent 56ca38d commit 800eec4

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

build.gradle.kts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
import java.nio.charset.StandardCharsets
17+
import java.util.*
1618
import kotlin.io.path.absolutePathString
1719
import org.apache.tools.ant.filters.ReplaceTokens
1820
import org.gradle.internal.extensions.stdlib.capitalized
@@ -438,4 +440,16 @@ publishing {
438440
}
439441
}
440442

441-
signing { sign(publishing.publications["pklLsp"]) }
443+
signing {
444+
// provided as env vars `ORG_GRADLE_PROJECT_signingKey` and `ORG_GRADLE_PROJECT_signingPassword`
445+
// in CI.
446+
val signingKey =
447+
(findProperty("signingKey") as String?)?.let {
448+
Base64.getDecoder().decode(it).toString(StandardCharsets.US_ASCII)
449+
}
450+
val signingPassword = findProperty("signingPassword") as String?
451+
if (signingKey != null && signingPassword != null) {
452+
useInMemoryPgpKeys(signingKey, signingPassword)
453+
}
454+
sign(publishing.publications["pklLsp"])
455+
}

0 commit comments

Comments
 (0)