Skip to content

Commit

Permalink
Add Travis configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasMikula committed May 1, 2015
1 parent 4924e49 commit 9a4e906
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
language: java
jdk:
- oraclejdk8

os:
- linux

# run in container
sudo: false

# use framebuffer for UI
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

env:
global:
# ENC_PWD
- secure: "gKAzrngDxttmaZ5PM7zhlYmZOC9OGDc5vFhV3LZ3t+QRebQd+rZMrYqu71+BjlSbHM9Lp5Fj59yEjv5dkRPMbVdAVvQBK4pfBuOmrY5XJqqADDR63EI7QSiC7wzWP776mW7rb22DJKcyGf4FjnfDdXU9LENcmM2xMAjx0aNxL+A="
# GH_TOKEN
- secure: "aMKCaSTnelmitm7ubPFPNzEsXMLsB/aa6ttycyHn3vNUtrfEdrvgK3rgTs6KPdwvvlCsh845GqHZjtcNh+q74Bn+R73JQRe2m+IHk61DFhEj1U78kB14rtALkN4pX32HgLonPpKwVxfnAUc1jGWsXsNlSV8rtGMto5gTcqVK9yM="

# publish artifacts and Javadoc after a successful build
after_success:
- travis/publish.sh

before_deploy:
- export VERSION=$(gradle -q getVersion)
deploy:
provider: releases
api_key:
secure: "bpAttvhKOyYLTWJzQqBIGcCDZXC7ZV42D/OhztSDC1DDye5B2s1yNwwAvBvzftuiQUyHWG4Rr6o+Y0ZXdEuKPm8ABYqnaUDfEXuaP8mtKrVRB1np1NDY3MBCJalzBQe1/RHh7sm4zzvLWRndxaY76kmJA5gC5PMOtk3GDubIKmU="
file_glob: true
file:
- "build/libs/flowless-${VERSION}.jar"
- "build/libs/flowless-${VERSION}-javadoc.jar"
- "build/libs/flowless-${VERSION}-sources.jar"
- "build/libs/flowless-fat-${VERSION}.jar"
skip_cleanup: true
on:
tags: true
branch: master
repo: TomasMikula/Flowless
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ task fatJar(type: Jar, dependsOn: classes) {
}

assemble.dependsOn fatJar

task getVersion << {
println version
}
2 changes: 2 additions & 0 deletions gradle.properties.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Salted__`&y�R�pɈhӞ����Z� !�Zk�Χ%�Ć�F�� m���Q|r���AE&4�8,Zu׃~��d*�.:�gҷۙX:��' ����V{e�B�Ek�늍X�������S����+�~`
������aͿ��%`B��8�)�yH����Ј�����cʔ�1��>��HtҨ���n�
Expand Down
Binary file added secring.gpg.enc
Binary file not shown.
40 changes: 40 additions & 0 deletions travis/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

if [ "$TRAVIS_REPO_SLUG" == "TomasMikula/Flowless" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
openssl aes-256-cbc -d -k "$ENC_PWD" -in gradle.properties.enc -out gradle.properties
openssl aes-256-cbc -d -k "$ENC_PWD" -in secring.gpg.enc -out secring.gpg

echo -e "Starting publish to Sonatype...\n"

gradle uploadArchives
RETVAL=$?

if [ $RETVAL -eq 0 ]; then
echo 'Publish completed!'
else
echo 'Publish failed.'
return 1
fi

# publish Javadoc for non-SNAPSHOT versions
VERSION=$(gradle -q getVersion)
if [[ $VERSION != *SNAPSHOT* ]]; then

echo -e "Publishing javadoc...\n"

git config --global user.email "travis@travis-ci.org"
git config --global user.name "travis-ci"
git config --global push.default simple
git clone --quiet https://${GH_TOKEN}@github.com/FXMisc/fxmisc.github.io fxmisc

cd fxmisc
JAVADOC_DIR=./flowless/javadoc/$VERSION
git rm -rf $JAVADOC_DIR
cp -Rf ../build/docs/javadoc $JAVADOC_DIR
git add -f $JAVADOC_DIR
git commit -m "Javadoc for Flowless v$VERSION"
git push

fi

fi

0 comments on commit 9a4e906

Please sign in to comment.