rector/.travis.yml
2020-02-27 14:28:50 +01:00

50 lines
1.8 KiB
YAML

os: linux
dist: bionic
language: php
before_install:
# turn off XDebug
- phpenv config-rm xdebug.ini
jobs:
include:
# inspired by https://github.com/phpstan/phpstan-src/blob/088b9fab470632cea07f08a936fb0923a59b2ecb/.travis.yml#L47-L59
# "Deploy to https://github.com/rectorphp/rector-prefixed"
-
name: Compile and Release rector.phar
if: (branch = master OR tag IS present) && type = push
php: 7.2
script:
- cd compiler
# see https://gist.github.com/jeffersonmartin/d0d4a8dfec90d224d14f250b36c74d2f
# see https://www.previousnext.com.au/blog/managing-composer-github-access-personal-access-tokens
- composer config -g github-oauth.github.com $GITHUB_TOKEN
- composer install
- bin/compile --ansi
- ../tmp/rector.phar
- cd ..
# reuse tmp/rector.phar from previous job
- git clone https://${GITHUB_TOKEN}@github.com/rectorphp/rector-prefixed.git rector-prefixed > /dev/null 2>&1
- cp tmp/rector.phar rector-prefixed/rector.phar
- cp tmp/rector.phar rector-prefixed/rector
- cd rector-prefixed
- git config user.name "TomasVotruba"
- git config user.email "tomas.vot@gmail.com"
- git add rector rector.phar
- if [ "${TRAVIS_TAG}" != "" ]; then COMMIT_MSG="Rector ${TRAVIS_TAG}"; else COMMIT_MSG="Updated Rector to commit ${TRAVIS_COMMIT}"; fi
- git commit -m "${COMMIT_MSG}"
- git push --quiet origin master -f
- if [ "${TRAVIS_TAG}" != "" ]; then git tag "${TRAVIS_TAG}" && git push --quiet origin ${TRAVIS_TAG}; fi
notifications:
email: false