Publish artifacts to oss.jfrog.org and Bintray

See updates to ethereumj-core/README.md for details.
This commit is contained in:
Chris Beams 2014-12-29 15:35:42 +01:00
parent 310d7ea043
commit be51e4d958
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73
3 changed files with 91 additions and 170 deletions

View File

@ -3,8 +3,29 @@
### Include ethereum-core in your project
1. Add http://dl.bintray.com/ethereum/maven as a repository to your build script
2. Add a dependency on `org.ethereum:ethereumj:$version`, where `$version` is one of those listed at https://bintray.com/ethereum/maven/org.ethereum/view
#### For snapshot builds:
- Add https://oss.jfrog.org/libs-snapshot/ as a repository to your build script
- Add a dependency on `org.ethereum:ethereumj-core:${VERSION}`, where `${VERSION}` is of the form `0.7.14-SNAPSHOT`.
Example:
<repository>
<id>jfrog-snapshots</id>
<name>oss.jfrog.org</name>
<url>https://oss.jfrog.org/libs-snapshot/</url>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<!-- ... -->
<dependency>
<groupId>org.ethereum</groupId>
<artifactId>ethereumj-core</artifactId>
<version>0.7.14-SNAPSHOT</version>
</dependency>
#### For release builds:
_There are no release builds at this time. Use snapshots in the meantime._
### Examples
@ -38,4 +59,6 @@ Run `../gradlew install`.
#### Publish ethereumj-core builds
_TODO: integrate bintray gradle plugin_
Push to master.
Run `../gradlew release`. Snapshots will be published to oss.jfrog.org; releases will be published to Bintray. You must supply the `bintrayUser` and `bintrayKey` properties to the Gradle build in order to authenticate. Do this in $HOME/.gradle/gradle.properties for greatest convenience and security.

View File

@ -1,167 +0,0 @@
<!--
Publish from local ${user.home}/.m2/repository
to Bintray public repository:
e.g:
ethereumj-0.5.4.jar
ethereumj-0.5.4.pom
ethereumj-0.5.4-javadoc.jar
ethereumj-0.5.4-sources.jar
[groupId('.'->'/')]\[artifactId]\[version]
[artifactId]-[version][suffix]
(*) if [artifact.snapshot] is set the deploy will add timestamp to the package
delete api with bash:
curl -X DELETE https://api.bintray.com/packages/ethereum/maven/org.ethereum/versions/0.7.14.20141224.1153 &
-->
<project name="ethereumj-bintray" default="publish" basedir=".">
<tstamp/>
<property name="artifact.groupId" value="org.ethereum"/>
<property name="artifact.id" value="ethereumj"/>
<property name="artifact.version" value="0.7.14"/>
<property name="artifact.path" value=""/>
<property name="artifact.snapshot" value="snapshot"/>
<property name="repo.location" value="${user.home}/.m2/repository"/>
<property name="artifact.group.path" value="${artifact.groupId}"/>
<property name="artifact.full.path" value=""/>
<property file="credentials.properties"/>
<property name="ant.contrib.lib" value="${user.home}/.ant/lib/ant-contrib-1.0b3.jar"/>
<property name="ant.missinglink.lib" value="${user.home}/.ant/lib/ml-ant-http-1.1.3.jar"/>
<property name="bintray.subject" value="ethereum"/>
<property name="bintray.repo" value="maven"/>
<property name="bintray.package" value="${artifact.groupId}"/>
<condition property="bintray.version" value="${artifact.version}.${DSTAMP}.${TSTAMP}"
else="${artifact.version}">
<isset property="artifact.snapshot"/>
</condition>
<property name="bintray.publish" value="1"/>
<property name="bintray.file.path" value="${artifact.groupId}/${artifact.id}/${bintray.version}"/>
<property name="encoded.bintray.file.path" value=""/>
<taskdef name="http" classname="org.missinglink.ant.task.http.HttpClientTask">
<classpath>
<pathelement location="${ant.missinglink.lib}"/>
</classpath>
</taskdef>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${ant.contrib.lib}"/>
</classpath>
</taskdef>
<target name="definePath">
<!--[groupId('.'->'/')]\[artifactId]\[version]-->
<!--[artifactId]-[version][suffix]-->
<propertyregex property="artifact.group.path"
input="${artifact.groupId}"
regexp="\."
replace="/"
global="true"
override="true"/>
<var name="artifact.full.path" unset="true"/>
<property name="artifact.full.path"
value="${repo.location}/${artifact.group.path}/${artifact.id}/${artifact.version}/"/>
<var name="bintray.file.path" unset="true"/>
<property name="bintray.file.path"
value="${artifact.group.path}/${artifact.id}/${bintray.version}/${artifact.id}-${bintray.version}"/>
<echo message="${bintray.file.path}"/>
</target>
<target name="dependency" description="install dependency">
<mkdir dir="${user.home}/.ant/lib"/>
<get src="https://github.com/romanman/libs/raw/master/ant-contrib-1.0b3.jar"
dest="${ant.contrib.lib}"/>
<get src="https://github.com/romanman/libs/raw/master/ml-ant-http-1.1.3.jar"
dest="${ant.missinglink.lib}"/>
</target>
<target name="publish" depends="dependency, definePath">
<parallel>
<antcall target="upload">
<param name="artifact.suffix" value=".pom"/>
</antcall>
<antcall target="upload">
<param name="artifact.suffix" value=".jar"/>
</antcall>
<antcall target="upload">
<param name="artifact.suffix" value="-sources.jar"/>
</antcall>
<antcall target="upload">
<param name="artifact.suffix" value="-javadoc.jar"/>
</antcall>
</parallel>
</target>
<target name="upload">
<urlencode property="encoded.bintray.file.path"
value="${bintray.file.path}"
override="true"/>
<echo message="${artifact.full.path}/${artifact.id}-${artifact.version}${artifact.suffix}"/>
<http url="https://api.bintray.com/content/${bintray.subject}/${bintray.repo}/${bintray.package}/${bintray.version}/${encoded.bintray.file.path}${artifact.suffix};publish=1;override=1"
method="PUT"
printrequest="false"
printrequestheaders="true"
printresponse="true"
expected="201">
<credentials username="${username}"
password="${password}"
show="true"/>
<entity file="${artifact.full.path}/${artifact.id}-${artifact.version}${artifact.suffix}" binary="true"/>
</http>
</target>
</project>

View File

@ -2,9 +2,13 @@ plugins {
id 'application'
id 'jacoco'
id 'maven'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '1.2.0'
id 'me.champeau.gradle.antlr4' version '0.1'
id 'com.github.kt3k.coveralls' version '2.0.1x'
id 'com.jfrog.artifactory' version '3.0.1'
id 'com.jfrog.bintray' version '1.0'
}
mainClassName = 'org.ethereum.Start'
@ -91,3 +95,64 @@ artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
def bintrayUsername = project.hasProperty('bintrayUser') ? project.bintrayUser : ''
def bintrayPassword = project.hasProperty('bintrayKey') ? project.bintrayKey : ''
def pullRequest = System.getenv('TRAVIS_PULL_REQUEST')
artifactory {
contextUrl = 'http://oss.jfrog.org/artifactory'
publish {
repository {
repoKey = 'oss-snapshot-local'
username = bintrayUsername
password = bintrayPassword
}
defaults {
publications ('mavenJava')
}
}
resolve {
repository {
repoKey = 'libs-release'
}
}
}
artifactoryPublish.onlyIf {
(!pullRequest || pullRequest == 'false') && project.version.endsWith('-SNAPSHOT')
}
bintray {
user = bintrayUsername
key = bintrayPassword
publications = ['mavenJava']
dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload
pkg {
userOrg = 'ethereum' //An optional organization name when the repo belongs to one of the user's orgs
repo = 'maven'
name = 'org.ethereum'
}
}
bintrayUpload.onlyIf {
(!pullRequest || pullRequest == 'false') && !project.version.endsWith('-SNAPSHOT')
}
task release {
description = "Releases snapshot versions to oss.jfrog.org and releases to Bintray"
dependsOn artifactoryPublish, bintrayUpload
}