rector/.travis.yml

50 lines
1.8 KiB
YAML
Raw Normal View History

2020-01-20 12:34:31 +00:00
os: linux
dist: bionic
language: php
before_install:
# turn off XDebug
- phpenv config-rm xdebug.ini
jobs:
include:
2020-01-20 12:42:47 +00:00
# inspired by https://github.com/phpstan/phpstan-src/blob/088b9fab470632cea07f08a936fb0923a59b2ecb/.travis.yml#L47-L59
# "Deploy to https://github.com/rectorphp/rector-prefixed"
2020-01-20 12:34:31 +00:00
-
2020-01-20 12:42:47 +00:00
name: Compile and Release rector.phar
2020-02-27 13:28:50 +00:00
if: (branch = master OR tag IS present) && type = push
2020-01-20 12:34:31 +00:00
php: 7.2
script:
- cd compiler
2020-02-27 11:29:22 +00:00
# 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
2020-01-20 12:34:31 +00:00
- composer install
2020-02-27 11:29:22 +00:00
- bin/compile --ansi
2020-01-20 12:34:31 +00:00
- ../tmp/rector.phar
2020-01-20 12:42:47 +00:00
- cd ..
2020-01-20 12:34:31 +00:00
# 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}"
2020-01-28 22:17:48 +00:00
- git push --quiet origin master -f
2020-01-20 12:34:31 +00:00
- if [ "${TRAVIS_TAG}" != "" ]; then git tag "${TRAVIS_TAG}" && git push --quiet origin ${TRAVIS_TAG}; fi
notifications:
email: false