language: cpp
os:
  - linux
  - osx

script:
  - export TKDND_VERSION=`cat VERSION`
  - export TKDND_HOME=`pwd`
  - export TKDND_RUNTIME=${TKDND_HOME}/cmake/runtime
  - export FILE_TO_UPLOAD=${TKDND_HOME}/tkdnd-${TKDND_VERSION}-${TRAVIS_OS_NAME}-x64.tgz
  - echo ${FILE_TO_UPLOAD}
  - ./configure --prefix=${TKDND_RUNTIME} --exec-prefix=${TKDND_RUNTIME} && make && make test
  - make install

before_deploy:
  - make install
  - export FILE_TO_UPLOAD=${TKDND_HOME}/tkdnd-${TKDND_VERSION}-${TRAVIS_OS_NAME}-x64.tgz
  - cd ${TKDND_RUNTIME}/lib && tar -czvf ${FILE_TO_UPLOAD} tkdnd${TKDND_VERSION}
  - cd ${TKDND_HOME}
  - echo ${FILE_TO_UPLOAD}

deploy:
  provider: releases
  api_key:
    - secure: " "
  file_glob: false
  file: "${FILE_TO_UPLOAD}"
  skip_cleanup: true
  on:
    tags: true
