.travis.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. language: java
  2. sudo: false
  3. jdk:
  4. - oraclejdk9
  5. branches:
  6. except:
  7. - continuous # To avoid infinite loops, as this tag is created by this Travis config
  8. cache:
  9. directories:
  10. - $HOME/.m2
  11. env:
  12. global:
  13. - secure: "IfYURwZaDWuBDvyn47n0k1Zod/IQw1FF+CS5nnV08Q+NfC3vGGJMwV8m59XnbfwnWGxwvCaAbk4qP6s6+ijgZNKkvgfFMo3rfTok5zt43bIqgaFOANYV+OC/1c59gYD6ZUxhW5iNgMgU3qdsRtJuwSmfkVv/jKyLGfAbS4kN8BA=" # COVERITY_SCAN_TOKEN
  14. - secure: "lV9OwUbHMrMpLUH1CY+Z4puLDdFXytudyPlG1eGRsesdpuG6KM3uQVz6uAtf6lrU8DRbMM/T7ML+PmvQ4UoPPYLdLxESLLBat2qUPOIVBOhTSlCc7I0DmGy04CSvkeMy8dPaQC0ukgNiR7zwoNzfcpGRN/U9S8tziDruuHoZSrg=" # BINTRAY_API_KEY
  15. - secure: "oWFgRTVP6lyTa7qVxlvkpm20MtVc3BtmsNXQJS6bfg2A0o/iCQMNx7OD59BaafCLGRKvCcJVESiC8FlSylVMS7CDSyYu0gg70NUiIuHp4NBM5inFWYCy/PdQsCTzr5uvNG+rMFQpMFRaCV0FrfM3tLondcVkhsHL68l93Xoexx4=" # CODACY_PROJECT_TOKEN
  16. - secure: "zJxgytA2Ks5Xzv+7kUaUq+EBFNQw9Qec63lcMJVuXVWczjL16nKW1EzzV515ag+OWL46z3lEPForDhufw0VtFnNmaX68jkO0mp01eLrHApc1llN2Y/U8GBXfNNazN4+Kom4H+z/AO+wJr8EsKMMUczCdQ3APgd9uVI0hzXw/Z3M=" # GITHUB_API_KEY
  17. addons:
  18. apt:
  19. packages:
  20. - haveged
  21. coverity_scan:
  22. project:
  23. name: "cryptomator/cryptomator"
  24. notification_email: sebastian.stenzel@cryptomator.org
  25. build_command: "mvn -fmain/pom.xml clean test -DskipTests"
  26. branch_pattern: release.*
  27. install:
  28. - curl -o $HOME/.m2/settings.xml https://gist.githubusercontent.com/cryptobot/cf5fbd909c4782aaeeeb7c7f4a1a43da/raw/e60ee486e34ee0c79f89f947abe2c83b4290c6bb/settings.xml
  29. - mvn -fmain/pom.xml clean install -DskipTests org.codehaus.mojo:versions-maven-plugin:help dependency:go-offline -Pcoverage,release # "clean install" needed until we can exclude artifacts currently in the reactor, see https://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html#excludeReactor and https://issues.apache.org/jira/browse/MDEP-568
  30. script:
  31. - mvn --update-snapshots -fmain/pom.xml clean test jacoco:report verify -Pcoverage
  32. after_success:
  33. - jdk_switcher use oraclejdk8
  34. - curl -o ~/codacy-coverage-reporter-assembly-latest.jar https://oss.sonatype.org/service/local/repositories/releases/content/com/codacy/codacy-coverage-reporter/2.0.1/codacy-coverage-reporter-2.0.1-assembly.jar
  35. - $JAVA_HOME/bin/java -cp ~/codacy-coverage-reporter-assembly-latest.jar com.codacy.CodacyCoverageReporter -l Java -r main/jacoco-report/target/site/jacoco-aggregate/jacoco.xml
  36. before_deploy:
  37. - jdk_switcher use oraclejdk9
  38. - |
  39. if [[ $TRAVIS_BRANCH == "develop" ]] && [[ $TRAVIS_PULL_REQUEST == "false" ]]; then
  40. CONTINUOUS_RELEASE_URL=`curl -s https://api.github.com/repos/cryptomator/cryptomator/releases/tags/continuous | jq -re '.url'`
  41. echo "Existing continuous release: ${CONTINUOUS_RELEASE_URL}"
  42. if [[ $CONTINUOUS_RELEASE_URL == http* ]]; then
  43. curl -u cryptobot:$GITHUB_API_KEY -X DELETE $CONTINUOUS_RELEASE_URL
  44. fi
  45. fi
  46. - |
  47. if [[ -n "$TRAVIS_TAG" ]]; then
  48. mvn -fmain/pom.xml org.codehaus.mojo:versions-maven-plugin:set -DnewVersion=$TRAVIS_TAG
  49. elif [[ $TRAVIS_BRANCH == "develop" ]] && [[ $TRAVIS_PULL_REQUEST == "false" ]]; then
  50. mvn -fmain/pom.xml org.codehaus.mojo:versions-maven-plugin:set -DnewVersion=SNAPSHOT-$(echo $TRAVIS_COMMIT | head -c7)
  51. git tag -f continuous
  52. git remote add gh https://cryptobot:${GITHUB_API_KEY}@github.com/cryptomator/cryptomator.git
  53. git push -f gh continuous
  54. git remote remove gh
  55. fi
  56. - mvn -fmain/pom.xml clean package -Prelease -DskipTests
  57. deploy:
  58. - provider: releases # CONTINUOUS
  59. prerelease: true
  60. api-key: $GITHUB_API_KEY
  61. tag_name: continuous
  62. overwrite: true
  63. file_glob: true
  64. file:
  65. - "main/uber-jar/target/Cryptomator-*.jar"
  66. - "main/ant-kit/target/antkit.tar.gz"
  67. skip_cleanup: true
  68. name: Cryptomator continuous build
  69. body: Automatically built on $(date +'%F %T %Z').
  70. on:
  71. repo: cryptomator/cryptomator
  72. branch: develop
  73. condition: $TRAVIS_TAG = ''
  74. - provider: releases # RELEASE
  75. prerelease: false
  76. api_key: $GITHUB_API_KEY
  77. file:
  78. - "main/uber-jar/target/Cryptomator-$TRAVIS_TAG.jar"
  79. - "main/ant-kit/target/antkit.tar.gz"
  80. skip_cleanup: true
  81. on:
  82. repo: cryptomator/cryptomator
  83. tags: true
  84. - provider: script
  85. script: "curl -X POST -u cryptobot:${BINTRAY_API_KEY} -H 'Content-Type: application/json' -d '{\"name\": \"${TRAVIS_TAG}\", \"vcs_tag\": \"${TRAVIS_TAG}\"}' https://api.bintray.com/packages/cryptomator/cryptomator/cryptomator-win/versions"
  86. on:
  87. repo: cryptomator/cryptomator
  88. tags: true
  89. - provider: script
  90. script: "curl -X POST -u cryptobot:${BINTRAY_API_KEY} -H 'Content-Type: application/json' -d '{\"name\": \"${TRAVIS_TAG}\", \"vcs_tag\": \"${TRAVIS_TAG}\"}' https://api.bintray.com/packages/cryptomator/cryptomator/cryptomator-osx/versions"
  91. on:
  92. repo: cryptomator/cryptomator
  93. tags: true