Skip to content

Commit

Permalink
Merge pull request #20 from heiglandreas/feature/deployPhar
Browse files Browse the repository at this point in the history
Adds an automated deploy for phar-file on tagging
  • Loading branch information
heiglandreas authored Jan 18, 2017
2 parents 6901760 + c706fe3 commit 86219a9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
15 changes: 13 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ matrix:
- php: 7.0
env:
- TEST_COVERAGE=true
- CREATE_PHAR=true
- BUILD_PHAR=true
- php: 7.1
- php: 5.6

Expand All @@ -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'
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}

0 comments on commit 86219a9

Please sign in to comment.