Skip to content

Commit 0b03c7e

Browse files
committed
Limit gradle workers in CI artifact upload
1 parent 60db5e8 commit 0b03c7e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,15 @@ jobs:
109109
echo "IS_SNAPSHOT_VERSION=$IS_SNAPSHOT_VERSION" >> $GITHUB_ENV
110110
- name: Publish to Sonatype Nexus
111111
run: |
112-
./gradlew publish --info
112+
# --max-workers 1 limits Gradle to a single thread even if parallel builds are enabled in the hopes
113+
# of making the the upload to Sonatype Nexus less flaky
114+
./gradlew publish --info --max-workers 1
113115
114116
if [[ "$IS_SNAPSHOT_VERSION" == "true" ]]; then
115117
echo "Version is a snapshot. No closing of the repository is necessary."
116118
elif [[ "$IS_SNAPSHOT_VERSION" == "false" ]]; then
117119
echo "Version is not a snapshot. Trying to close and release repository."
118-
./gradlew closeAndReleaseRepository --info
120+
./gradlew closeAndReleaseRepository --info --max-workers 1
119121
else
120122
echo "IS_SNAPSHOT_VERSION has unknown value: $IS_SNAPSHOT_VERSION"
121123
exit 1

0 commit comments

Comments
 (0)