forked from silverstripe/silverstripe-upgrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
73 lines (64 loc) · 1.97 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
language: php
dist: trusty
cache:
directories:
- $HOME/.composer/cache/files
matrix:
fast_finish: true
include:
- php: 7.1
env:
- LINT_TEST=1
- SYMFONY="4.0.*"
- php: 7.2
env:
- SYMFONY="3.2.*"
- php: 7.3
env:
- SYMFONY="^4"
- php: 7.1
env:
- RELEASE=1
sudo: false
before_script:
# Init php
- phpenv rehash
- phpenv config-rm xdebug.ini
- export PATH=~/.composer/vendor/bin:$PATH
- if [[ $SYMFONY ]]; then rm composer.lock; fi
# Install composer dependencies
- composer validate
- if [[ $SYMFONY ]]; then composer require symfony/console:$SYMFONY symfony/process:$SYMFONY symfony/filesystem:$SYMFONY --no-update; fi
- composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
- composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o
script:
- vendor/bin/phpunit --color tests
- if [[ $LINT_TEST ]]; then composer run-script lint; fi
before_deploy:
- if [ -d "release" ]; then rm -rf release ; fi
- git clone --single-branch --branch gh-pages https://github.com/$TRAVIS_REPO_SLUG.git release
- echo "UPGRADER_VERSION=$TRAVIS_TAG" > .env
- php build.php
- if [[ ! -f ./upgrade-code.phar ]]; then exit 1; fi
- mv upgrade-code.phar ./release/
- mkdir release/$TRAVIS_TAG
- cp release/upgrade-code.phar release/$TRAVIS_TAG/upgrade-code.phar
- (cd release && md5sum upgrade-code.phar */upgrade-code.phar > MD5SUM)
deploy:
- provider: releases
skip_cleanup: true
api_key: $GITHUB_API_TOKEN
file: release/upgrade-code.phar
on:
tags: true
repo: silverstripe/silverstripe-upgrader
condition: -n $RELEASE
- provider: pages
skip_cleanup: true
keep-history: true
github-token: $GITHUB_API_TOKEN
local-dir: release
on:
tags: true
repo: silverstripe/silverstripe-upgrader
condition: -n $RELEASE