Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 3249f1a

Browse files
committed
Fix the sign error
1 parent f37fb5d commit 3249f1a

File tree

3 files changed

+33
-16
lines changed

3 files changed

+33
-16
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ jobs:
3232
env:
3333
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
3434
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
35+
MAVEN_GPG_KEY_ID: ${{secrets.OSSRH_GPG_SECRET_KEY_ID }}
3536
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
36-
run: ./gradlew -Ptarget=release clean publish
37+
run: ./gradlew -Ptarget=release -Psigning.gnupg.executable=gpg2 -Psigning.gnupg.passphrase=${MAVEN_GPG_PASSPHRASE} -Psigning.gnupg.keyName="${MAVEN_GPG_KEY_ID}" clean publish closeAndReleaseRepository

.github/workflows/snapshot-deploy.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
run: |
2222
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
2323
gpg --list-secret-keys --keyid-format LONG
24+
- name: debug
25+
run: ls -al /home/runner/.gnupg
26+
2427
- name: Set up JDK
2528
uses: actions/setup-java@v2
2629
with:
@@ -34,5 +37,6 @@ jobs:
3437
env:
3538
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
3639
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
40+
MAVEN_GPG_KEY_ID: ${{secrets.OSSRH_GPG_SECRET_KEY_ID }}
3741
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
38-
run: ./gradlew -Ptarget=snapshot clean publish
42+
run: ./gradlew -Ptarget=snapshot -Psigning.gnupg.executable=gpg2 -Psigning.gnupg.passphrase=${MAVEN_GPG_PASSPHRASE} -Psigning.gnupg.keyName="${MAVEN_GPG_KEY_ID}" clean publish

build.gradle

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
['java', 'maven-publish', 'signing', 'jacoco'].each {
2-
apply plugin : it
1+
plugins {
2+
id "java-library"
3+
id "maven-publish"
4+
id 'signing'
5+
id 'jacoco'
6+
id "io.codearte.nexus-staging" version "0.30.0"
37
}
48

9+
510
def profile = "snapshot"
611
if (project.hasProperty('target')) {
712
profile = "$target"
@@ -32,7 +37,7 @@ repositories {
3237
dependencies {
3338
testImplementation(platform("org.junit:junit-bom:5.7.2"))
3439
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-bom
35-
testImplementation(platform("org.apache.logging.log4j:log4j-bom:2.14.1"))
40+
implementation(platform("org.apache.logging.log4j:log4j-bom:2.14.1"))
3641

3742
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.27'
3843
implementation 'org.slf4j:jcl-over-slf4j:1.7.29'
@@ -64,24 +69,24 @@ dependencies {
6469
runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'
6570
}
6671

72+
nexusStaging {
73+
username = System.getenv("MAVEN_USERNAME")
74+
password = System.getenv("MAVEN_PASSWORD")
75+
packageGroup = 'com.github.poad'
76+
}
77+
6778
publishing {
6879
publications {
6980
release(MavenPublication) {
7081
from components.java
7182

72-
project.tasks.withType(Sign) {
73-
signatures.all {
74-
def type = it.type
75-
if (it.file.name.endsWith('.tar.gz.asc')) { // Workaround in case a tar.gz file should published
76-
type = 'tar.gz.asc'
77-
} else if (it.type.equals('xml.asc')) { // Set correct extension for signature of pom file
78-
type = 'pom.asc'
79-
}
80-
artifact source: it.file, classifier: it.classifier ?: null, extension: type
83+
pom {
84+
signing {
85+
useGpgCmd()
86+
sign publishing.publications.release
87+
sign configurations.archives
8188
}
82-
}
8389

84-
pom {
8590
name = "Amazon Web Services S3 Maven Wagon Support"
8691
description = "Standard Maven wagon support for s3:// urls"
8792
url = "https://github.com/poad/aws-maven"
@@ -133,6 +138,13 @@ publishing {
133138
}
134139
}
135140

141+
142+
javadoc {
143+
if(JavaVersion.current().isJava9Compatible()) {
144+
options.addBooleanOption('html5', true)
145+
}
146+
}
147+
136148
test {
137149
useJUnitPlatform {
138150
includeEngines 'junit-jupiter', 'junit-vintage'

0 commit comments

Comments
 (0)