forked from rectorphp/rector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
49 lines (37 loc) · 1.83 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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.4
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 --ansi
- bin/compile --ansi
- ../tmp/rector.phar --ansi
- 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