osx_image: xcode10.2
xcode_project: MacPass.xcodeproj
xcode_scheme: MacPass
language: objective-c

before_install:
  - carthage bootstrap --platform macOS
  - gem install xcpretty --no-document --quiet

after_success:
  - cd ./build/Build/Products/Release
  - zip -9ry MacPass-continuous.zip MacPass.app
  - shasum -a 256 MacPass-continuous.zip > MacPass-continuous.zip.sha256
  - cd -
  - mv ./build/Build/Products/Release/MacPass-continuous.zip .
  - mv ./build/Build/Products/Release/MacPass-continuous.zip.sha256 .

script: |
  set -o pipefail
  xcodebuild clean
  xcodebuild build -configuration release -project MacPass.xcodeproj  -scheme MacPass CODE_SIGNING_REQUIRED=NO -derivedDataPath ./build | xcpretty -c

branches:
  only:
    - /^(?i:continuous)$/

deploy:
  skip_cleanup: true
  provider: releases
  api_key:
    secure: AEb7fgi29S3aXFt5bXz+lq1KHISumny6bf4j06JBC5gUrSs+dW0/tmVFq68XRAqigeOQU31wwv20f7OHiy+GRYDXM2xBsX9ZBQ2IilnaXlDy/mPsNcJJJsZ2gyodi3KnU0rZtTb93me2YyU86H4Na/gtaZZUKjLwCFtGGziExD8=
  file: 
    - MacPass-continuous.zip
    - MacPass-continuous.zip.sha256
  overwrite: true
  on:
    tags: true
    repo: MacPass/MacPass
    branch: continuous
