|
1 | | -dist: trusty # Beta build environment (newer OS, at least it seems) |
2 | | -sudo: false # Container instead of VM (thus, a lot faster) |
| 1 | +# General settings |
| 2 | +dist: trusty |
| 3 | +sudo: false |
3 | 4 | language: node_js |
| 5 | +node_js: |
| 6 | + - "lts/*" |
4 | 7 | cache: |
5 | 8 | directories: |
6 | 9 | - node_modules |
7 | 10 | notifications: |
8 | 11 | email: false |
9 | 12 | branches: |
10 | 13 | only: |
11 | | - - master # Testing, Building, Releasing |
12 | | - - develop # Testing, Building |
13 | | - - feature/travis # Branch specifically for testing Travis CI |
| 14 | + - master |
| 15 | + - develop |
| 16 | + - /^greenkeeper/.*$/ |
14 | 17 |
|
15 | | -before_install: |
16 | | - - if [ "$TRAVIS_BRANCH" == "master" ]; then |
17 | | - git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG"; |
18 | | - cd "$TRAVIS_REPO_SLUG"; |
19 | | - git checkout -qf "$TRAVIS_COMMIT"; |
20 | | - fi |
21 | | - - npm install -g npm |
22 | | -install: |
23 | | - - npm install |
| 18 | +# Build stages |
| 19 | +stages: |
| 20 | + - name: build |
| 21 | + - name: test |
| 22 | + - name: release |
| 23 | + if: branch = master |
24 | 24 |
|
25 | | -script: |
26 | | - - npm run lint |
27 | | - - npm run ci:test && npm run ci:coverage |
28 | | - - npm run build |
| 25 | +# Build jobs |
| 26 | +jobs: |
| 27 | + include: |
29 | 28 |
|
30 | | -before_deploy: |
31 | | - - git config --global user.name "dominique-mueller" |
32 | | - - git config --global user.email "dominique.m.mueller@gmail.com" |
33 | | - - git config credential.helper "store --file=.git/credentials" |
34 | | - - echo "https://$GH_TOKEN:@github.com" > .git/credentials |
35 | | - - git checkout master |
36 | | - - npm run ci:automatic-release |
37 | | - - npm run ci:post-automatic-release |
38 | | - - npm install -g irish-pub@0.2.x pkg-ok@1.1.x |
39 | | - - cd dist && pkg-ok module es2015 typings && cd .. |
40 | | - - irish-pub |
41 | | -deploy: |
42 | | - provider: npm |
43 | | - email: dominique.m.mueller@gmail.com |
44 | | - api_key: "$NPM_TOKEN" |
45 | | - skip_cleanup: true |
46 | | - on: |
47 | | - branch: master |
48 | | - repo: dominique-mueller/angular-notifier |
| 29 | + - stage: build |
| 30 | + env: |
| 31 | + - ANGULAR=5.0.x |
| 32 | + install: |
| 33 | + - npm install |
| 34 | + - npm install @angular/common@$ANGULAR @angular/core@$ANGULAR |
| 35 | + script: |
| 36 | + - npm run build:js |
| 37 | + - npm run build:sass |
| 38 | + - npm run build:css |
| 39 | + - |
| 40 | + env: |
| 41 | + - ANGULAR=5.1.x |
| 42 | + install: |
| 43 | + - npm install |
| 44 | + - npm install @angular/common@$ANGULAR @angular/core@$ANGULAR |
| 45 | + script: |
| 46 | + - npm run build:js |
| 47 | + - npm run build:sass |
| 48 | + - npm run build:css |
| 49 | + |
| 50 | + - stage: test |
| 51 | + env: |
| 52 | + - ANGULAR=5.0.x |
| 53 | + install: |
| 54 | + - npm install |
| 55 | + - npm install @angular/common@$ANGULAR @angular/core@$ANGULAR |
| 56 | + script: |
| 57 | + - npm run test |
| 58 | + - |
| 59 | + env: |
| 60 | + - ANGULAR=5.1.x |
| 61 | + install: |
| 62 | + - npm install |
| 63 | + - npm install @angular/common@$ANGULAR @angular/core@$ANGULAR |
| 64 | + script: |
| 65 | + - npm run test |
| 66 | + after_success: |
| 67 | + - npm run test:coverage |
| 68 | + |
| 69 | + - stage: release |
| 70 | + before_install: |
| 71 | + # Clone the whole repository because we also need the develop branch for releasing (Travis only gives us the master by default) |
| 72 | + - git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG"; |
| 73 | + - cd "$TRAVIS_REPO_SLUG"; |
| 74 | + - git checkout -qf "$TRAVIS_COMMIT"; |
| 75 | + # Fix Travis CI issue of detached heads in git |
| 76 | + - git checkout master |
| 77 | + install: |
| 78 | + - npm install |
| 79 | + script: |
| 80 | + - npm run build:js |
| 81 | + - npm run build:sass |
| 82 | + - npm run build:css |
| 83 | + before_deploy: |
| 84 | + # Login to Git to be able to make commits (required by automatic-release) |
| 85 | + - git config --global user.name "dominique-mueller"; |
| 86 | + - git config --global user.email "dominique.m.mueller@gmail.com"; |
| 87 | + - git config credential.helper "store --file=.git/credentials"; |
| 88 | + - echo "https://$GH_TOKEN:@github.com" > .git/credentials; |
| 89 | + # Do release |
| 90 | + - npm run release |
| 91 | + # Publish the dist folder |
| 92 | + - cd dist |
| 93 | + deploy: |
| 94 | + provider: npm |
| 95 | + email: dominique.m.mueller@gmail.com |
| 96 | + api_key: "$NPM_TOKEN" |
| 97 | + skip_cleanup: true |
| 98 | + after_deploy: |
| 99 | + - cd .. |
0 commit comments