language: java
dist: trusty

env:
  - MVN="mvn --update-snapshots --settings ${TRAVIS_BUILD_DIR}/.travis.settings.xml"

addons:
  sonarcloud:
    organization: retest
    token:
      secure: "${SONAR_CLOUD_TOKEN}"

notifications:
  email: false

cache:
  directories:
    - "${HOME}/.sonar/cache/"
    - "${HOME}/.m2/"

install: true

script:
  - ${MVN} clean org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar

before_deploy:
  # decrypt ReTest secret key
  - openssl aes-256-cbc -K "${encrypted_58a7d4f10478_key}" -iv "${encrypted_58a7d4f10478_iv}"
      -in retest-gmbh-gpg.asc.enc -out retest-gmbh-gpg.asc -d
  # import decrypted ReTest secret key
  - gpg --fast-import retest-gmbh-gpg.asc
  # package sign artifacts
  - ${MVN} verify -DskipTests -Psign

deploy:
  # draft release on GitHub
  - provider: releases
    api_key: "${GH_TOKEN}"
    skip_cleanup: true
    draft: true
    on:
      tags: true

  # deploy artifacts to Maven Central
  - provider: script
    script: ${MVN} deploy -DskipTests -Psign
    on:
      tags: true

language: java
dist: trusty

env:
  - MVN="mvn --update-snapshots --settings ${TRAVIS_BUILD_DIR}/.travis.settings.xml"

addons:
  sonarcloud:
    organization: retest
    token:
      secure: "${SONAR_CLOUD_TOKEN}"

notifications:
  email: false

cache:
  directories:
    - "${HOME}/.sonar/cache/"
    - "${HOME}/.m2/"

install: true

script:
  - ${MVN} clean org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar

before_deploy:
  # decrypt ReTest secret key
  - openssl aes-256-cbc -K "${encrypted_58a7d4f10478_key}" -iv "${encrypted_58a7d4f10478_iv}"
      -in retest-gmbh-gpg.asc.enc -out retest-gmbh-gpg.asc -d
  # import decrypted ReTest secret key
  - gpg --fast-import retest-gmbh-gpg.asc
  # package sign artifacts
  - ${MVN} verify -DskipTests -Psign

deploy:
  # deploy artifacts to Maven Central
  - provider: script
    script: ${MVN} deploy -DskipTests -Psign
    on:
      tags: true

Revert "Readd GitHub release provider"
Revert "Readd GitHub release provider"

This reverts commit 3b5a2650b998184a8352c6b480790cd7b6a01761.
