]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
sign jar for Maven Central repo
authorNicholas Albion <redacted>
Thu, 7 Sep 2023 01:45:01 +0000 (11:45 +1000)
committerNicholas Albion <redacted>
Thu, 7 Sep 2023 01:45:44 +0000 (11:45 +1000)
.github/workflows/build.yml
bindings/java/build.gradle

index 08eda870a6bcd85b9de0899b00403b57254616f0..a12f3f5afb281ec00aeaece01fd6d7bc11374d2a 100644 (file)
@@ -437,6 +437,8 @@ jobs:
           MAVEN_PASSWORD: ${{ secrets.JIRA_PASS }}
           # MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
           # MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
+          PGP_SECRET: ${{ secrets.PGP_SECRET }}
+          PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
 
   quantize:
     runs-on: ubuntu-latest
index 8e2bc2ccc077d3cbdf69d7c1164fddb27de6b49c..8f7a5fd928f5305f1714bf0891f04ac06ad5653b 100644 (file)
@@ -2,6 +2,7 @@ plugins {
     id 'java'\r
     id 'java-library'\r
     id 'maven-publish'\r
+    id 'signing'\r
 }\r
 \r
 archivesBaseName = 'whispercpp'\r
@@ -112,7 +113,9 @@ publishing {
 \r
     repositories {\r
         maven {\r
-            url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'\r
+            def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'\r
+            def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'\r
+            url = version.endsWith('-SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl\r
             credentials {\r
                 username = System.getenv("MAVEN_USERNAME")\r
                 password = System.getenv("MAVEN_PASSWORD")\r
@@ -120,3 +123,10 @@ publishing {
         }\r
     }\r
 }\r
+\r
+signing {\r
+    def signingKey = System.getenv("PGP_SECRET")\r
+    def signingPassword = System.getenv("PGP_PASSPHRASE")\r
+    useInMemoryPgpKeys(signingKey, signingPassword)\r
+    sign publishing.publications.mavenJava\r
+}\r