.travis.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. - secure: "PiH/o9MLOyPdjIwECIEfj3TuUxx7QB0CIs3o1WXjqb1PbDdHDbQyvswYit6xDw9NrJp/A+ov2k00jq+n+8fLTSd4AY21y5WiJN/ccCTWUuUiFhGxOyM37aeWAPAn4rUp7D7o8jLxEdpGZAfglIzaz+GCEQYxfV/w3FDwztViXgQ=" # GPG_PASSPHRASE
  18. addons:
  19. apt:
  20. packages:
  21. - haveged
  22. coverity_scan:
  23. project:
  24. name: "cryptomator/cryptomator"
  25. notification_email: sebastian.stenzel@cryptomator.org
  26. build_command: "mvn -fmain/pom.xml clean test -DskipTests"
  27. branch_pattern: release.*
  28. install:
  29. - curl -o $HOME/.m2/settings.xml https://gist.githubusercontent.com/cryptobot/cf5fbd909c4782aaeeeb7c7f4a1a43da/raw/e60ee486e34ee0c79f89f947abe2c83b4290c6bb/settings.xml
  30. - 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
  31. script:
  32. - mvn --update-snapshots -fmain/pom.xml clean test verify -Pcoverage
  33. after_success:
  34. - jdk_switcher use oraclejdk8
  35. - curl -o ~/codacy-coverage-reporter-assembly-latest.jar https://oss.sonatype.org/service/local/repositories/releases/content/com/codacy/codacy-coverage-reporter/4.0.1/codacy-coverage-reporter-4.0.1-assembly.jar
  36. - $JAVA_HOME/bin/java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r main/commons/target/site/jacoco/jacoco.xml --partial
  37. - $JAVA_HOME/bin/java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r main/keychain/target/site/jacoco/jacoco.xml --partial
  38. - $JAVA_HOME/bin/java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r main/ui/target/site/jacoco/jacoco.xml --partial
  39. - $JAVA_HOME/bin/java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r main/launcher/target/site/jacoco/jacoco.xml --partial
  40. - $JAVA_HOME/bin/java -jar ~/codacy-coverage-reporter-assembly-latest.jar final
  41. before_deploy:
  42. - jdk_switcher use oraclejdk9
  43. - |
  44. if [[ $TRAVIS_BRANCH == "develop" ]] && [[ $TRAVIS_PULL_REQUEST == "false" ]]; then
  45. CONTINUOUS_RELEASE_URL=`curl -s https://api.github.com/repos/cryptomator/cryptomator/releases/tags/continuous | jq -re '.url'`
  46. echo "Existing continuous release: ${CONTINUOUS_RELEASE_URL}"
  47. if [[ $CONTINUOUS_RELEASE_URL == http* ]]; then
  48. curl -u cryptobot:$GITHUB_API_KEY -X DELETE $CONTINUOUS_RELEASE_URL
  49. fi
  50. fi
  51. - |
  52. if [[ -n "$TRAVIS_TAG" ]]; then
  53. mvn -fmain/pom.xml org.codehaus.mojo:versions-maven-plugin:set -DnewVersion=$TRAVIS_TAG
  54. elif [[ $TRAVIS_BRANCH == "develop" ]] && [[ $TRAVIS_PULL_REQUEST == "false" ]]; then
  55. mvn -fmain/pom.xml org.codehaus.mojo:versions-maven-plugin:set -DnewVersion=SNAPSHOT-$(echo $TRAVIS_COMMIT | head -c7)
  56. git tag -f continuous
  57. git remote add gh https://cryptobot:${GITHUB_API_KEY}@github.com/cryptomator/cryptomator.git
  58. git push -f gh continuous
  59. git remote remove gh
  60. fi
  61. - mvn -fmain/pom.xml clean package -Prelease -DskipTests
  62. - gpg --import 34C80F11.gpg
  63. - gpg --detach-sign -a -u 34C80F11 --batch --passphrase ${GPG_PASSPHRASE} main/ant-kit/target/antkit.tar.gz
  64. deploy:
  65. - provider: releases # CONTINUOUS
  66. prerelease: true
  67. api-key: $GITHUB_API_KEY
  68. tag_name: continuous
  69. overwrite: true
  70. file_glob: true
  71. file:
  72. - "main/uber-jar/target/Cryptomator-*.jar"
  73. - "main/ant-kit/target/antkit.tar.gz"
  74. - "main/ant-kit/target/antkit.tar.gz.asc"
  75. skip_cleanup: true
  76. name: Cryptomator continuous build
  77. body: Automatically built on $(date +'%F %T %Z').
  78. on:
  79. repo: cryptomator/cryptomator
  80. branch: develop
  81. condition: $TRAVIS_TAG = ''
  82. - provider: releases # RELEASE
  83. prerelease: false
  84. api_key: $GITHUB_API_KEY
  85. file:
  86. - "main/uber-jar/target/Cryptomator-$TRAVIS_TAG.jar"
  87. - "main/ant-kit/target/antkit.tar.gz"
  88. - "main/ant-kit/target/antkit.tar.gz.asc"
  89. skip_cleanup: true
  90. on:
  91. repo: cryptomator/cryptomator
  92. tags: true
  93. - provider: script
  94. 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"
  95. on:
  96. repo: cryptomator/cryptomator
  97. tags: true
  98. - provider: script
  99. 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"
  100. on:
  101. repo: cryptomator/cryptomator
  102. tags: true