Skip to content

Commit e801bea

Browse files
committed
Use new gradle-nexus publish-plugin for less flaky publishing
1 parent 10452a7 commit e801bea

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ jobs:
114114
run: |
115115
# --max-workers 1 limits Gradle to a single thread even if parallel builds are enabled in the hopes
116116
# of making the the upload to Sonatype Nexus less flaky
117-
./gradlew publish --info --max-workers 1
117+
./gradlew publishToSonatype --info --max-workers 1
118118
119119
if [[ "$IS_SNAPSHOT_VERSION" == "true" ]]; then
120120
echo "Version is a snapshot. No closing of the repository is necessary."
121121
elif [[ "$IS_SNAPSHOT_VERSION" == "false" ]]; then
122122
echo "Version is not a snapshot. Trying to close and release repository."
123-
./gradlew closeAndReleaseRepository --info --max-workers 1
123+
./gradlew closeAndReleaseStagingRepository --info --max-workers 1
124124
else
125125
echo "IS_SNAPSHOT_VERSION has unknown value: $IS_SNAPSHOT_VERSION"
126126
exit 1

build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ buildscript {
1616
}
1717

1818
plugins {
19-
id 'io.codearte.nexus-staging' version '0.30.0' //can only be applied to root project
19+
id "io.github.gradle-nexus.publish-plugin" version "1.0.0" //can only be applied to root project
2020
}
2121

2222
apply from: 'versionTasks.gradle'
2323

24-
nexusStaging {
25-
username = "$System.env.SONATYPE_NEXUS_USERNAME"
26-
password = "$System.env.SONATYPE_NEXUS_PASSWORD"
24+
nexusPublishing {
25+
repositories {
26+
sonatype {
27+
username = "$System.env.SONATYPE_NEXUS_USERNAME"
28+
password = "$System.env.SONATYPE_NEXUS_PASSWORD"
29+
}
30+
}
2731
}
2832

2933
allprojects {

0 commit comments

Comments
 (0)