diff --git a/.travis.yml b/.travis.yml index 457618b..7e5da15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ env: stages: - test + - build - deploy before_script: make before_script @@ -31,21 +32,16 @@ script: composer test jobs: include: - - stage: deploy + - stage: build before_script: skip script: make build_archive - before_deploy: - - export VERSION=`cat VERSION` - - export ARCHIVE_NAME=/tmp/retailcrm-$VERSION.zip - - git config --local user.name "retailCRM" - - git config --local user.email "support@retailcrm.ru" - - export TRAVIS_TAG=v$VERSION - - git tag $TRAVIS_TAG + - stage: deploy + before_script: skip + before_deploy: make tag deploy: provider: releases api_key: $GITHUB_OAUTH_TOKEN skip_cleanup: true file: $ARCHIVE_NAME - if: (branch = master) AND (type = push) AND (fork = true) - on: - php: 7.1 \ No newline at end of file + if: (branch = master) AND (type = push) AND (fork = true) + after_deploy: make delete_archive \ No newline at end of file diff --git a/Makefile b/Makefile index 1bd8b47..1ae58e1 100644 --- a/Makefile +++ b/Makefile @@ -20,4 +20,12 @@ before_script: composer setup bin/robo --load-from tests/RoboFile.php project:deploy (php -S localhost:8000 -t www &) 2> /dev/null > /dev/null - sleep 2 \ No newline at end of file + sleep 2 + +tag: + export VERSION=`cat VERSION` + export ARCHIVE_NAME=/tmp/retailcrm-$VERSION.zip + git config --local user.name "retailCRM" + git config --local user.email "support@retailcrm.ru" + export TRAVIS_TAG=v$VERSION + git tag $TRAVIS_TAG \ No newline at end of file