Skip to content

Commit 30cb880

Browse files
committed
test gpg
1 parent 95d8f7d commit 30cb880

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

.github/workflows/publish_test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test
2+
3+
on:
4+
push: null
5+
6+
permissions:
7+
contents: write
8+
id-token: write
9+
10+
env:
11+
JAVA_VERSION: 21
12+
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v6
19+
- name: Set up JDK ${{ env.JAVA_VERSION }}
20+
uses: actions/setup-java@v5
21+
with:
22+
java-version: ${{ env.JAVA_VERSION }}
23+
distribution: 'temurin'
24+
cache: 'gradle'
25+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
26+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
27+
28+
- name: Setup Gradle
29+
uses: gradle/actions/setup-gradle@v6
30+
31+
- name: Build with Gradle
32+
run: ./gradlew --parallel assemble javadoc alldoc
33+
34+
- run: export GPG_TTY=$(tty)
35+
- name: Upload to SNAPSHOT repository
36+
run: ./gradlew --parallel publishMavenJavaPublicationToKEYLABRepository
37+
env:
38+
BUILD_NUMBER: "SNAPSHOT"
39+
GITLAB_DEPLOY_TOKEN: ${{ secrets.GITLAB_DEPLOY_TOKEN }}
40+
# SIGNING_KEY_ID: ${{secrents.SIGNING_KEY_ID}}
41+
# GPG_PRIVATE_KEY: ${{secrents.GPG_PRIVATE_KEY}}
42+
# GPG_PASSPHRASE: ${{secrents.GPG_PASSPHRASE}}
43+

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,16 +359,18 @@ subprojects {
359359
}
360360
}
361361
signing {
362-
//sign publishing.publications.mavenJava
362+
sign publishing.publications.mavenJava
363363
}
364364
}
365365
}
366366

367367
signing {
368368
// does not work
369369
if(System.getenv("GPG_PRIVATE_KEY") == null) {
370+
println("Use useGpgCmd()")
370371
useGpgCmd() // works better than the Java implementation, which requires PGP keyrings.
371372
} else{
373+
println("Useinmem")
372374
useInMemoryPgpKeys(
373375
System.getenv("SIGNING_KEY_ID"),
374376
System.getenv("GPG_PRIVATE_KEY"),

0 commit comments

Comments
 (0)