diff --git a/.travis.yml b/.travis.yml index a6f894d..8524bcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ matrix: - php: 7.0 env: - TEST_COVERAGE=true - - CREATE_PHAR=true + - BUILD_PHAR=true - php: 7.1 - php: 5.6 @@ -24,9 +24,20 @@ install: - if [[ $TEST_COVERAGE == 'true' && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then travis_retry composer require --dev satooshi/php-coveralls ; fi - if [[ $TEST_COVERAGE == 'true' && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then travis_retry composer require --dev codeclimate/php-test-reporter:dev-master ; fi - composer install + script: -- composer test + - composer test + - if [[ $BUILD_PHAR == 'true' && $TRAVIS_TAG != '' ]]; then composer buildphar ; fi after_script: - if [[ $TEST_COVERAGE == 'true' && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then travis_retry vendor/bin/coveralls -v ; fi - if [[ $TEST_COVERAGE == 'true' && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then vendor/bin/test-reporter --coverage-report=clover.xml ; fi + +deploy: + provider: releases + api_key: $GITHUB_API_KEY + file: build/junitdiff.phar + skip_cleanup: true + on: + tags: true + php: '7.0' diff --git a/composer.json b/composer.json index f4065fa..62aa3d8 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,14 @@ "mockery/mockery": "^0.9.5" }, "scripts": { - "test": "phpunit --coverage-text --coverage-clover clover.xml" + "test": "phpunit --coverage-text --coverage-clover clover.xml", + "buildphar" : [ + "rm -rf vendor", + "composer install --no-dev --prefer-dist", + "curl -o phar-composer -L `curl -s https://api.github.com/repos/clue/phar-composer/releases | grep browser_download_url | head -n 1 | cut -d '\"' -f 4`", + "chmod 755 phar-composer", + "chmod 755 phar-composer", + "./phar-composer build . build" + ] } }