language: erlang
matrix:
  include:
    - os: linux
      otp_release: R16B03-1
    - os: linux
      otp_release: 17.5
    - os: linux
      otp_release: 18.3
    - os: linux
      otp_release: 19.3
    - os: osx
      language: generic
before_script:
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
  ## should eventually use a tap that has previous erlang versions here
  ## as this only uses the latest erlang available via brew
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install erlang; fi
script: "./bootstrap && ./rebar3 ct"
branches:
  only:
  - master
cache:
  directories:
  - "$HOME/.cache/rebar3/hex/default"
deploy:
  - provider: releases
    api_key:
      secure: MjloYuaQF3cd3Oab57zqwPDLPqt5MDgBIrRLpXOQwNovr2tnkKd4aJK3QJ3pTxvZievjgl+qIYI1IZyjuRV37nkjAfMw14iig959wi0k8XTJoMdylVxE5X7hk4SiWhX/ycnJx3C28PPw1OitGTF76HAJDMgEelNdoNt+hvjvDEo=
    file: rebar3
    on:
      repo: erlang/rebar3
      tags: true
  - provider: s3
    access_key_id: AKIAJAPYAQEFYCYSNL7Q
    secret_access_key:
      secure: "BUv2KQABv0Q4e8DAVNBRTc/lXHWt27yCN46Fdgo1IrcSSIiP+hq2yXzQcXLbPwkEu6pxUZQtL3mvKbt6l7uw3wFrcRfFAi1PGTITAW8MTmxtwcZIBcHSk3XOzDbkK+fYYcaddszmt7hDzzEFPtmYXiNgnaMIVeynhQLgcCcIRRQ="
    skip_cleanup: true
    local-dir: _build/default/bin
    bucket: "rebar3-nightly"
    acl: public_read
    on:
      repo: erlang/rebar3
      branch: master
      condition: $TRAVIS_OTP_RELEASE = "R16B03-1"