Skip to content

Cleanup the build #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Stop publishing -SNAPSHOT on every CI build, since we have JitPack now.
  • Loading branch information
nedtwigg committed Jan 14, 2020
commit 4633a322196144d01f9c325ea21ef582bc14c1dd
7 changes: 0 additions & 7 deletions .ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,3 @@
# Do the Gradle build
./gradlew build --build-cache || exit 1
./gradlew npmTest --build-cache || exit 1

if [ "$TRAVIS_REPO_SLUG" == "diffplug/spotless" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
# Make sure that all pom are up-to-date
./gradlew generatePomFileForPluginMavenPublication --build-cache
# Publish the artifacts
./gradlew publish publishPlugins -Dgradle.publish.key=$gradle_key -Dgradle.publish.secret=$gradle_secret --build-cache || exit 1
fi
34 changes: 5 additions & 29 deletions gradle/java-publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
////////////////
// PUBLISHING //
////////////////
ext.isSnapshot = ext.version.endsWith('-SNAPSHOT')
// pulls the credentials from either the environment variable or gradle.properties
def cred = {
if (System.env[it] != null) {
return System.env[it]
} else if (project.hasProperty(it)) {
return project[it]
} else {
return 'unknown_' + it
}
}

final MAVEN_PLUGIN_ARTIFACT_NAME = 'spotless-maven-plugin'

model {
Expand Down Expand Up @@ -119,26 +107,14 @@ model {
}
}
}
if (project.ext.isSnapshot) {
// upload snapshots to oss.sonatype.org
repositories {
maven {
url = 'https://oss.sonatype.org/content/repositories/snapshots'
credentials {
username = cred('nexus_user')
password = cred('nexus_pass')
}
}
}
}
}
}

if (!ext.isSnapshot) {
if (!version.endsWith('-SNAPSHOT')) {
// upload releases to bintray and then mavenCentral
bintray {
user = cred('bintray_user')
key = cred('bintray_pass')
user = System.env['bintray_user']
key = System.env['bintray_pass']
publications = [
'pluginMaven'
]
Expand All @@ -150,8 +126,8 @@ if (!ext.isSnapshot) {
version {
name = project.ext.version
mavenCentralSync {
user = cred('nexus_user')
password = cred('nexus_pass')
user = System.env['nexus_user']
password = System.env['nexus_pass']
}
}
}
Expand Down