language: cpp
jobs:
  include:
    - os: osx
      osx_image: xcode11.3
      script:
        - cmake -S. -Bbuild -DBINARY_RELEASE=ON
        - sudo cmake --build build --target package --config Release -j $(sysctl -n hw.physicalcpu)
    - os: linux
      dist: bionic
      arch: ppc64le
      script:
        # CMake 3.10: no -S/-B and -j is build tool specific.
        - mkdir -p build && cd build
        - cmake .. -DBINARY_RELEASE=ON
        - cmake --build . --target package -- -j $(nproc)
addons:
  apt:
    packages:
    - libsodium-dev
    - libsdl2-mixer-dev
    - libsdl2-ttf-dev
  homebrew:
    brewfile: true

git:
  depth: false
  quiet: true

deploy:
  - provider: releases
    api_key: "$GITHUB_TOKEN"
    file: "build/devilutionx.dmg"
    skip_cleanup: true
    on:
      tags: true
      condition: $TRAVIS_OS_NAME = osx
  - provider: releases
    api_key: "$GITHUB_TOKEN"
    file: "build/devilutionx-linux-ppc64le.7z"
    skip_cleanup: true
    on:
      tags: true
      condition: $TRAVIS_OS_NAME == "linux" && $TRAVIS_CPU_ARCH == "ppc64le"
