Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/gradle/pace-snapshot-publishing.init.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.util.concurrent.TimeUnit
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository

// The snapshot workflow runs with --no-parallel. Space out its remote publications.
def publicationInterval = TimeUnit.SECONDS.toNanos(30)
long nextPublication = System.nanoTime()

gradle.beforeProject { project ->
project.tasks.withType(PublishToMavenRepository).configureEach { publication ->
publication.doFirst {
if (publication.repository.url.toString() == 'https://central.sonatype.com/repository/maven-snapshots/') {
long wait = nextPublication - System.nanoTime()
if (wait > 0) {
TimeUnit.NANOSECONDS.sleep(wait)
}
nextPublication = System.nanoTime() + publicationInterval
}
}
}
}
7 changes: 4 additions & 3 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
publish-snapshot:
runs-on: ubuntu-latest
if: github.repository == 'vRallev/app-platform'
timeout-minutes: 60
timeout-minutes: 110

steps:
- uses: actions/checkout@v4
Expand All @@ -33,8 +33,9 @@ jobs:

- name: Publish snapshot
run: |
./gradlew clean publish -PRELEASE_SIGNING_ENABLED=true --no-build-cache --stacktrace --show-version --no-configuration-cache
./gradlew -p gradle-plugin clean publish -PRELEASE_SIGNING_ENABLED=true --no-build-cache --stacktrace --show-version --no-configuration-cache
publish_flags=(--init-script "$PWD/.github/gradle/pace-snapshot-publishing.init.gradle" --no-parallel -Dorg.gradle.internal.network.retry.initial.backOff=10000)
./gradlew clean publish -PRELEASE_SIGNING_ENABLED=true --no-build-cache --stacktrace --show-version --no-configuration-cache "${publish_flags[@]}"
./gradlew -p gradle-plugin clean publish -PRELEASE_SIGNING_ENABLED=true --no-build-cache --stacktrace --show-version --no-configuration-cache "${publish_flags[@]}"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_PORTAL_USERNAME_RALF }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PORTAL_PASSWORD_RALF }}
Expand Down
Loading