aboutsummaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: b7cd2511749d10bc69cbd42fce815d4c143c8d44 (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
68
69
70
71
72
73
74
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: xcode12

language: node_js
node_js:
  - 14
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 -m "Merge remote-tracking branch 'source/develop' into HEAD [skip ci]" source/develop
      CHANGES_COUNT=$(git diff --stat HEAD origin/nightly | wc -l)
      echo "Travis event type: $TRAVIS_EVENT_TYPE"
      echo "Number of changes: $CHANGES_COUNT"
      if [ $CHANGES_COUNT -eq 0 -a $TRAVIS_EVENT_TYPE == "cron" ]; then
        echo "Terminating the build since there are no changes in a cron-triggered build"
        travis_terminate 0
      else
        echo "Found changes, proceeding with submodule updates"
        git submodule update --remote --force
        git add .
        git commit -m "Update submodules [skip ci]" || true
      fi
      echo "Completed merging from develop branch and upgrading submodules"
    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 for release..."
      travis_retry travis_wait 100 npm run build -- --publish always -c.publish.provider=github -c.publish.owner=getferdi -c.publish.repo=ferdi -c.mac.identity=null
    fi
  - |
    if [ $TRAVIS_BRANCH == "nightly" ]; then
      git add .
      git commit -m "Apply linter fixes [skip ci]"
      npm version prerelease --preid=nightly -m "%s and trigger AppVeyor nightly build [skip travisci]"
      echo "Building for nightly..."
      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