sudo: false

language: php

branches:
  only:
    - stable

cache:
  directories:
    - $HOME/.composer/cache

before_install:
  - composer self-update

install:
  - composer install --no-dev --no-interaction --ignore-platform-reqs
  - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip .
  - composer require --update-no-dev --no-interaction "topthink/think-image:^1.0"
  - composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0"
  - composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0"
  - composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0"
  - composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0"
  - composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0"
  - composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0"
  - composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0"
  - composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0"
  - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip .

script:
  - php think unit

deploy:
  provider: releases
  api_key:
    secure:  
  file:
    - ThinkPHP_Core.zip
    - ThinkPHP_Full.zip
  skip_cleanup: true
  on:
    tags: true
