language: cpp

env:
  global:
   - secure: "Q7+8APe7r5vkUO+77VUoWlRW7ERFZ2WYkYTMo5QCfhqldpm5furgeJsLTivux/RiEWjpJ/Ez64pZWET2rQbVPdKvxIbt9kebQ4klQFZIcbq0z7h9AKMMv2RMGBkl01oU5Mj07CIlJr59dnGnNftPMSoe9Vg9TVQu8gJGkiR/W4q8LTxj7iHl12d8e4A3Wf//9Pu2TZt2IuYToDOhrFgZ7sy5QN/6Uiz/m65fLDR2lSaO5nzAao4eXEB6uQ2BVH5vHqTAXLKPzrIb9PGkrlY1CDyZ4ECng7lCjP4+i3nGTPg+Y5gnH7c0JmAG9NFhEXj+CgxGnMvZcwCwv5GbLnY2LLJgWQSBSo9OMO88bns//6cQmFtMlW8ZZhd2jyIQxG6wOC4CVKvEbzsoLnhEuW9yVCAiY3WoJfqyGg0UVtgimcjEJ7ynB6A7jgCMoEQN7K3MmwXMDKcy9RR6RbaFRPuoCaPg2e4uhWtI2Q0HZZ/i6SGVtmH9OXn0QnxfxHoJkCHyHYcVrzE67bbrq7H1s5aPJn1AJRx1c7RkVOxW+a/m9umOuJWLJkNB/D5gnk2QgDe9o1s+n2em1bG7iC8V396MoIGDlEl6LiOSwsSlzrg4kxHdNnfClkFeiWNYrORZYxeF/2HBcqhh1TekK74C57Sz1IdUYSZnZwy5tJRrQ996SxE="
   - FORCE_INSTALL=1

matrix:
  include:
  - os: osx
    name: "Build"
    osx_image: xcode11.6
    compiler: clang

    script:
      - git clone https://github.com/acidanthera/MacKernelSDK
      - src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/Lilu/master/Lilu/Scripts/bootstrap.sh) && eval "$src" || exit 1
      - xcodebuild -jobs 1 -target Package -configuration Debug
      - xcodebuild -jobs 1 -target Package -configuration Release

    deploy:
      provider: releases
      skip_cleanup: true
      file: "build/*/*.zip"
      file_glob: true
      api_key:
        secure: KVG0KIW/HASu1RMYLkjiCnnrxgmJ6l4g+jNU9WLmwCreIF6QRi/oFpsj6wSCq/QDUSRGqkyxRfXzBsvmwFsbd8lgjnhiL3XGlTUnG4f7EQHN3c/vikWZS65zwI4KjmyAv0/tup2SwBoALIqS+blZT8BfGfBqxkFGvakmXfsm98MFHSBn7Jkrz7gEmXkh0Zs5FIlA5fw7ljQOx1NyVTaC+aaZtP2+lxeVWL8CU0KKVONpnsx5YtSZGtCXvrj9dhr4Ti0U6NQhl9m/gYrymLqy4N9ubgJ8setxZgG/sz3CdFZFKx750SSUCbRbh5R9BeFsU3p7M0p69Oka9Jo+tOLA42xYCrBW7dqK89DfZo/MV6zONmuXhvCIQkO3QtkzaJJBBuZzu01LALz9gn5udvBMC9OU4p07xtIPgeIFb2anjkg0gKcdZfCcUeUVimwwSzMrW5STJB/psBvVs/4oLwIna52mEzS0brR6EU0f2ZrYMpF4UIDjSsXBN605ORl2G1dGK5+gpVw2/GPb7w3h35ZVroO56Mked6oo6P3qSZAEsyJv/LHbUFJWigNXRvTlNUZf52OQmKi9TuVipzFgs/GA1maHhXVHjS7DREs5oOSWdolvXQSXqhZr0a1CC3fS58S3K9x0eltammQVyoIw5vEzNlBo5jXA/rnydgoGy8rZM9s=
      on:
        tags: true

  - os: osx
    name: "Analyze Clang"
    osx_image: xcode11
    compiler: clang

    script:
      - git clone https://github.com/acidanthera/MacKernelSDK
      - src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/Lilu/master/Lilu/Scripts/bootstrap.sh) && eval "$src" || exit 1
      - xcodebuild analyze -quiet -scheme Package -target Package -configuration Debug CLANG_ANALYZER_OUTPUT=plist-html CLANG_ANALYZER_OUTPUT_DIR="$(pwd)/clang-analyze" && [ "$(find clang-analyze -name "*.html")" = "" ]
      - xcodebuild analyze -quiet -scheme Package -target Package -configuration Release CLANG_ANALYZER_OUTPUT=plist-html CLANG_ANALYZER_OUTPUT_DIR="$(pwd)/clang-analyze" && [ "$(find clang-analyze -name "*.html")" = "" ]

  - os: osx
    name: "Analyze Coverity"
    osx_image: xcode10.2
    compiler: clang

    before_install:
      - git clone https://github.com/acidanthera/MacKernelSDK
      - curl -Ls https://entrust.com/root-certificates/entrust_l1k.cer -o ~/entrust_l1k.crt || exit 1
      - curl -LS https://curl.haxx.se/ca/cacert.pem -o ~/cacert.pem || exit 1
      - cat ~/entrust_l1k.crt >> ~/cacert.pem || exit 1
      - echo "cacert=\"$HOME/cacert.pem\"" > ~/.curlrc || exit 1
      - echo "ca_certificate=$HOME/cacert.pem" > ~/.wgetrc || exit 1

    script:
      - echo "This script runs coverity..."

    addons:
      coverity_scan:
        project:
          name: "acidanthera/VirtualSMC"
          description: "VirtualSMC"
        notification_email: $NOTIFICATION_EMAIL
        build_command_prepend: "src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/Lilu/master/Lilu/Scripts/bootstrap.sh) && eval \"$src\" || exit 1 ; src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/Lilu/master/Lilu/Scripts/covstrap.sh) && eval \"$src\" || exit 1"
        build_command: "xcodebuild -target Package -configuration Release"
        branch_pattern: master
