Skip to content

Commit

Permalink
manually upload to Bintray
Browse files Browse the repository at this point in the history
  • Loading branch information
Franz Becker committed Sep 8, 2017
1 parent 71dfbf1 commit 7ac74ec
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 31 deletions.
43 changes: 40 additions & 3 deletions .travis-publishOnRelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,43 @@
# Execute only on tag builds where the tag starts with 'v'

if [[ -n "$TRAVIS_TAG" && "$TRAVIS_TAG" == v* ]]; then
echo "Publishing version: $TRAVIS_TAG"
./gradlew bintrayUpload --stacktrace --debug
fi
version="${TRAVIS_TAG//v}"
echo "Publishing version: $version"

# Manually upload the p2 update site as the Gradle plugin simply does not work
# see https://github.com/bintray/gradle-bintray-plugin/issues/87
owner=test-editor
repo=p2
package=updatesite
version="${TRAVIS_TAG//v}"

function bintrayUpload {
local path=$1
echo "Uploading $path"
echo " ... $(curl -sT $path \
-u$BINTRAY_USER:$BINTRAY_KEY \
-H "X-Bintray-Package:$package" \
-H "X-Bintray-Version:$version" \
"https://api.bintray.com/content/$owner/$repo/$package/$version/$path"
)"
}

function bintrayPublish {
echo "Publishing version: $version"
echo " ... $(curl -sX POST \
-u$BINTRAY_USER:$BINTRAY_KEY \
https://api.bintray.com/content/$owner/$repo/$package/$version/publish
)"
}

function uploadTargetPlatform() {
cd rcp/org.testeditor.rcp4.updatesite/target/site
find . -type f |
while read file; do
bintrayUpload $file;
done
bintrayPublish
}

uploadTargetPlatform
fi
27 changes: 0 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'com.moowork.node' version '1.2.0'
id 'com.jfrog.bintray' version '1.7.3'
}

node {
Expand Down Expand Up @@ -68,32 +67,6 @@ task buildProduct(type: MavenExec) {
args 'package' , '-Pproduct', '-DskipTests', '-Dtycho.localArtifacts=ignore'
}

artifacts {
updatesite file('rcp/org.testeditor.rcp4.updatesite/target/site')
}

bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
configurations = ['updatesite']
publish = true
pkg {
githubRepo = 'test-editor/test-editor-xtext'
githubReleaseNotesFile = 'README.md'
repo = 'p2'
name = 'updates'
userOrg = 'test-editor'
licenses = ['EPL-1.0']
websiteUrl = "https://github.com/${githubRepo}"
issueTrackerUrl = "https://github.com/${githubRepo}/issues"
vcsUrl = "${websiteUrl}.git"
version {
name = project.version
vcsTag = "v$project.version"
}
}
}

/**
* Rail-road diagram stuff below.
*/
Expand Down
1 change: 0 additions & 1 deletion gradle.properties

This file was deleted.

0 comments on commit 7ac74ec

Please sign in to comment.