Skip to content

Commit

Permalink
Publish SNAPSHOT builds to OSSRH instead of OJO. (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd236 authored Feb 16, 2021
1 parent 0e0c3d9 commit 3bd1975
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 34 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ tasks.withType(JavaCompile) {
}

apply from: 'rules.gradle'
apply from: 'bintray.gradle'
apply from: 'publish.gradle'
6 changes: 3 additions & 3 deletions publish-snapshot-on-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ GITHUB_BRANCH=${GITHUB_REF#refs/heads/}
if [ "$GITHUB_REPOSITORY" == "google/volley" ] && \
[ "$GITHUB_EVENT_NAME" == "push" ] && \
[ "$GITHUB_BRANCH" == "master" ]; then
echo -e "Publishing snapshot build to OJO...\n"
echo -e "Publishing snapshot build...\n"

./gradlew artifactoryPublish
./gradlew publish

echo -e "Published snapshot build to OJO"
echo -e "Published snapshot build"
else
echo -e "Not publishing snapshot"
fi
45 changes: 15 additions & 30 deletions bintray.gradle → publish.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.8.1"
}
}

// apply the plugin with its class name rather than its Id to work around gradle limitation of
// not being able to find the plugin by Id despite the dependencies being added right above. Gradle
// is currently not capable of loading plugins by Id if the dependency is anywhere else than
// in the main project build.gradle. This file is "imported" into the project's build.gradle
// through a "apply from:".
apply plugin: org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin
apply plugin: 'maven-publish'

task sourcesJar(type: Jar) {
Expand Down Expand Up @@ -42,13 +27,21 @@ publishing {
artifactId 'volley'
version project.version
pom {
name = 'Volley'
description = 'An HTTP library that makes networking for Android apps easier and, most importantly, faster.'
url = 'https://github.com/google/volley'
packaging 'aar'
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {
connection = 'scm:git:git:https://github.com/google/volley.git'
developerConnection = 'scm:git:ssh:https://[email protected]/google/volley.git'
url = 'https://github.com/google/volley'
}
}

// Release AAR, Sources, and JavaDoc
Expand All @@ -57,22 +50,14 @@ publishing {
artifact javadocJar
}
}
}

artifactory {
contextUrl = "https://oss.jfrog.org"
publish {
repository {
repoKey = 'oss-snapshot-local'
username = System.env.CI_DEPLOY_USERNAME
password = System.env.CI_DEPLOY_PASSWORD
}
defaults {
publications('library')
publishArtifacts = true
repositories {
maven {
url = "https://oss.sonatype.org/content/repositories/snapshots/"
credentials {
username = System.env.OSSRH_DEPLOY_USERNAME
password = System.env.OSSRH_DEPLOY_PASSWORD
}
}
}
resolve {
repoKey = 'jcenter'
}
}

0 comments on commit 3bd1975

Please sign in to comment.