Skip to content

Commit

Permalink
fixing audit module releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
coutoPL committed Nov 23, 2023
1 parent 2c80f6b commit 3cf71af
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 23 deletions.
40 changes: 22 additions & 18 deletions audit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@
plugins {
id "readonlyrest.base-common-conventions"

id "de.marcphilipp.nexus-publish" version "0.4.0"
id "io.codearte.nexus-staging" version "0.22.0"
id "com.github.prokod.gradle-crossbuild" version "0.14.1"
id "com.github.prokod.gradle-crossbuild" version "0.16.0"
id "java"
id "java-library"
id "maven-publish"
id "signing"
}

group = 'org.elasticsearch.plugin'
version = pluginVersion

dependencyCheck {
/*
Severity Base Score
Expand Down Expand Up @@ -132,6 +128,8 @@ tasks.register('javadocJar', Jar) {

group = 'tech.beshu.ror'
archivesBaseName = 'audit'
version = pluginVersion

publishing {
publications {
crossBuildV211(MavenPublication) {
Expand Down Expand Up @@ -166,26 +164,32 @@ publishing {
}

signing {
sign publishing.publications
sign(publishing.publications)
}

//region Fix Gradle warning about signing tasks using publishing task outputs without explicit dependencies
// https://github.com/gradle/gradle/issues/26091
tasks.withType(AbstractPublishToMaven.class).configureEach {
def signingTasks = tasks.withType(Sign.class)
mustRunAfter(signingTasks)
}

nexusPublishing {
packageGroup = "tech.beshu"

repositories {
sonatype {
packageGroup = 'tech.beshu'
stagingProfileId = System.getenv('MAVEN_STAGING_PROFILE_ID')
username = System.getenv('MAVEN_REPO_USER')
password = System.getenv('MAVEN_REPO_PASSWORD')
}
}
clientTimeout = java.time.Duration.ofSeconds(120)
}

nexusStaging {
packageGroup = 'tech.beshu'
stagingProfileId = System.getenv('MAVEN_STAGING_PROFILE_ID')
username = System.getenv('MAVEN_REPO_USER')
password = System.getenv('MAVEN_REPO_PASSWORD')
numberOfRetries = 50
delayBetweenRetriesInMillis = 10000
}
clientTimeout = Duration.ofSeconds(120)
connectTimeout = Duration.ofSeconds(60)

transitionCheckOptions {
maxRetries.set(50)
delayBetween.set(java.time.Duration.ofMillis(10000))
}
}
4 changes: 2 additions & 2 deletions bin/run-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ if [[ $ROR_TASK == "publish_artifacts" ]] && [[ $TRAVIS_BRANCH == "master" ]] ;

if [[ $CURRENT_PLUGIN_VER == $PUBLISHED_PLUGIN_VER ]]; then
echo ">>> Publishing audit module artifacts to sonatype repo"
./gradlew audit:publishToSonatype
./gradlew audit:closeAndReleaseRepository
./gradlew publish
./gradlew closeAndReleaseSonatypeStagingRepository
else
echo ">>> Skipping publishing audit module artifacts"
fi
Expand Down
23 changes: 20 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
/*
* This file is part of ReadonlyREST.
*
* ReadonlyREST is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ReadonlyREST is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ReadonlyREST. If not, see http://www.gnu.org/licenses/
*/
import tech.beshu.ror.gradle.RorTaskFinder

plugins { id 'base' }
plugins {
id 'base'
id "io.github.gradle-nexus.publish-plugin" version "2.0.0-rc-1"
}

tasks.register("buildRorPlugin", RorTaskFinder) {
dependsOn it.findRorTaskForEsVersion()
}


0 comments on commit 3cf71af

Please sign in to comment.