aboutsummaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: 56fc094e423edf05ae8c342b745b1630dafbeac0 (plain) (blame)
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
matrix:
  fast_finish: true
  include:
    - os: linux
      dist: xenial
      addons:
        apt:
          packages:
            - libx11-dev
            - libxext-dev
            - libxss-dev
            - libxkbfile-dev
            - rpm
    - os: osx
      if: branch IN (nightly, release)
      osx_image: xcode11

language: node_js
git:
  submodules: false
branches:
  only:
    - develop
    - release
    - nightly
cache: npm

before_install:
  - git submodule update --init --recursive
  - |
    if [ $TRAVIS_BRANCH == "nightly" ]; then
      git remote add source https://${GH_TOKEN}@github.com/getferdi/ferdi.git > /dev/null 2>&1
      git fetch source
      git merge --no-ff --commit --no-edit source/develop
      CHANGES_COUNT=$(git diff --stat HEAD origin/nightly | wc -l)
      echo $TRAVIS_EVENT_TYPE
      echo $changes
      if [ $CHANGES_COUNT -eq 0 -a $TRAVIS_EVENT_TYPE == "cron" ]; then
        travis_terminate 0;
      else
        git submodule update --remote --force
        git add .
        git diff-index --quiet HEAD || git commit -m "Update submodules"
      fi
    fi
install:
  - cd recipes && npm install && npm run package && cd ..
  - travis_retry npx lerna bootstrap
  - travis_retry npm install node-sass -g
before_script:
  - npm run lint && npm run test
script:
  - |
    if [ $TRAVIS_BRANCH == "release" ]; then
      echo "Building..."
      travis_retry travis_wait 100 npm run build 
    fi
  - |
    if [ $TRAVIS_BRANCH == "nightly" ]; then
      npm version prerelease --preid=nightly -m "%s and trigger AppVeyor nightly build [skip travisci]"
      echo "Building..."
      travis_retry travis_wait 100 npm run build -- --publish always -c.publish.provider=github -c.publish.owner=getferdi -c.publish.repo=nightlies
      if [ $TRAVIS_OS_NAME == "osx" ]; then
        git remote add nightly https://${GH_TOKEN}@github.com/getferdi/ferdi.git > /dev/null 2>&1
        git push --quiet --set-upstream nightly HEAD:nightly >/dev/null 2>&1
      fi
    fi