From 7ac74ecdd6611d41af9de3ae757f46ce7d10b8e3 Mon Sep 17 00:00:00 2001 From: Franz Becker Date: Fri, 8 Sep 2017 17:23:35 +0200 Subject: [PATCH] manually upload to Bintray --- .travis-publishOnRelease.sh | 43 ++++++++++++++++++++++++++++++++++--- build.gradle | 27 ----------------------- gradle.properties | 1 - 3 files changed, 40 insertions(+), 31 deletions(-) delete mode 100644 gradle.properties diff --git a/.travis-publishOnRelease.sh b/.travis-publishOnRelease.sh index 06c06cab..d18ede77 100755 --- a/.travis-publishOnRelease.sh +++ b/.travis-publishOnRelease.sh @@ -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 \ No newline at end of file + 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 diff --git a/build.gradle b/build.gradle index c23e1a3b..8f6ebb99 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,5 @@ plugins { id 'com.moowork.node' version '1.2.0' - id 'com.jfrog.bintray' version '1.7.3' } node { @@ -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. */ diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index 5c06d51c..00000000 --- a/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -version=0.0.3 \ No newline at end of file