From 4b57be19e189c9a31cfbf0017072be955da14c2d Mon Sep 17 00:00:00 2001
From: Akolzin Dmitry <akolzinvs@gmail.com>
Date: Wed, 19 Feb 2020 15:15:21 +0300
Subject: [PATCH] test

---
 .travis.yml | 3 +--
 Makefile    | 3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 72ac7a8..d5b56b7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -67,11 +67,10 @@ jobs:
         - git config --local user.email "support@retailcrm.ru"
         - export TRAVIS_TAG=v$VERSION
         - git tag $TRAVIS_TAG
-        - export DEPLOY=true
       deploy:
         provider: releases
         api_key: $GITHUB_OAUTH_TOKEN
         skip_cleanup: true
         file: $ARCHIVE_NAME
-      if: branch = master AND type = push AND env(DEPLOY) = true
+      if: branch = master AND type = push AND env(CURRENT_VERSION) != env(LAST_TAG)
       after_deploy: make delete_archive
\ No newline at end of file
diff --git a/Makefile b/Makefile
index cb286ce..9b5ceb9 100644
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,7 @@ before_script:
 	bin/robo --load-from tests/RoboFile.php project:deploy
 	(php -S localhost:8000 -t www &) 2> /dev/null > /dev/null
 	sleep 2
-
+	export LAST_TAG=`git describe --abbrev=0 --tags`
+	export CURRENT_VERSION=v`cat VERSION`
 covegare:
 	wget https://phar.phpunit.de/phpcov-2.0.2.phar && php phpcov-2.0.2.phar merge coverage/ --clover coverage.xml