Skip to content

Commit

Permalink
Publish to the Gradle Plugin Portal
Browse files Browse the repository at this point in the history
Fixes gh-8
  • Loading branch information
rwinch committed Jun 5, 2019
1 parent 8cf993e commit 01d1f0b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Jenkinsfile
Expand Up @@ -36,8 +36,12 @@ try {
withCredentials([string(credentialsId: 'spring-gpg-passphrase', variable: 'SIGNING_PASSWORD')]) {
withCredentials([usernamePassword(credentialsId: 'oss-token', passwordVariable: 'OSSRH_PASSWORD', usernameVariable: 'OSSRH_USERNAME')]) {
withCredentials([usernamePassword(credentialsId: '02bd1690-b54f-4c9f-819d-a77cb7a9822c', usernameVariable: 'ARTIFACTORY_USERNAME', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
withEnv(["JAVA_HOME=${ tool 'jdk8' }"]) {
sh "./gradlew clean deployArtifacts finalizeDeployArtifacts -Psigning.secretKeyRingFile=$SIGNING_KEYRING_FILE -Psigning.keyId=$SPRING_SIGNING_KEYID -Psigning.password='$SIGNING_PASSWORD' -PossrhUsername=$OSSRH_USERNAME -PossrhPassword=$OSSRH_PASSWORD -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --refresh-dependencies --no-daemon --stacktrace"
withCredentials([string(credentialsId: 'gradle-publish-key', variable: 'GRADLE_PUBLISH_KEY')]) {
withCredentials([string(credentialsId: 'gradle-publish-secret', variable: 'GRADLE_PUBLISH_SECRET')]) {
withEnv(["JAVA_HOME=${ tool 'jdk8' }"]) {
sh "./gradlew clean deployArtifacts finalizeDeployArtifacts -Pgradle.publish.key=$GRADLE_PUBLISH_KEY -Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET -Psigning.secretKeyRingFile=$SIGNING_KEYRING_FILE -Psigning.keyId=$SPRING_SIGNING_KEYID -Psigning.password='$SIGNING_PASSWORD' -PossrhUsername=$OSSRH_USERNAME -PossrhPassword=$OSSRH_PASSWORD -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --refresh-dependencies --no-daemon --stacktrace"
}
}
}
}
}
Expand Down
25 changes: 24 additions & 1 deletion nohttp-gradle/build.gradle
Expand Up @@ -27,15 +27,27 @@ buildscript {
plugins {
id 'java-gradle-plugin'
id 'groovy'
id 'maven-publish'
id 'com.gradle.plugin-publish' version '0.10.1'
}

apply plugin: 'io.spring.convention.spring-module'
apply plugin: 'kotlin'


pluginBundle {
website = 'https://github.com/spring-io/nohttp'
vcsUrl = 'https://github.com/spring-io/nohttp.git'
description = project.description
tags = ['check']
}

gradlePlugin {
plugins {
simplePlugin {
nohttpPlugin {
id = 'io.spring.nohttp'
displayName = 'nohttp Plugin'
description = project.description
implementationClass = 'io.spring.nohttp.gradle.NoHttpPlugin'
}
}
Expand All @@ -62,4 +74,15 @@ compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}

ext.snapshotBuild = version.contains("SNAPSHOT")

if (!snapshotBuild) {
project.tasks.named('deployArtifacts', new Action<Task>() {
@Override
void execute(Task deployArtifacts) {
deployArtifacts.dependsOn project.tasks.publishPlugins
}
})
}

0 comments on commit 01d1f0b

Please sign in to comment.