summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 607574b4271840ab92410e9e599f6823b74dad7a (plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# vim: set ts=2 sts=2 sw=2 expandtab :
dist: jammy
language: shell
os: linux
services:
  - docker
addons:
  apt:
    packages:
      - python3-pip
      - python3-setuptools

branches:
  except:
  - gh-pages

before_install:
  - curl -Ls -o docker-build https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/docker-build
  - curl -Ls -o gen-index https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/gen-index.sh
  - chmod +x docker-build gen-index

install:
  - sudo apt-get install -y python3-pip python3-setuptools
  - sudo pip3 install --upgrade pip
  - sudo pip3 install PyGithub
  - ./docker-build --name ${DISTRO} --config .build.yml --install

script:
  - ./docker-build --name ${DISTRO} --verbose --config .build.yml --build scripts

script:
  - ./docker-build --name ${DISTRO} --verbose --config .build.yml --build scripts

notifications:
  irc:
    if: (tag OR branch = master) AND
        repo = "mate-desktop/mate-applets"
    channels:
      - "irc.libera.chat#mate-dev"
    template:
      - "[%{repository_name}] %{author}: %{commit_subject}"
      - "[%{branch}] %{commit} %{message} %{build_url}"
    on_success: never
    on_failure: always

before_deploy:
  - yes | gem update --system --force
  - gem install bundler
  - gem install faraday-net_http -v '3.3.0' # Avoid faraday version problem
  - gem install uri
  - gem install logger

deploy:
  - provider: pages
    edge:
      branch: v2.0.5
    token: $GITHUB_TOKEN
    keep_history: false
    committer_from_gh: true
    target_branch: gh-pages
    local_dir: html-report
    strategy: git
    on:
      all_branches: true
      condition: ${DISTRO} =~ ^fedora.*$
  - provider: script
    edge:
      branch: v2.0.5
    script: ./docker-build --verbose --config .build.yml --release github
    on:
      tags: true
      condition: "${TRAVIS_TAG} =~ ^v.*$ && ${DISTRO} =~ ^fedora.*$"

after_success:
  - 'if [[ "$TRAVIS_SECURE_ENV_VARS" == "true" && "$TRAVIS_PULL_REQUEST" != "false" && ${DISTRO} =~ ^fedora.*$ ]]; then
        REPO_SLUG_ARRAY=(${TRAVIS_REPO_SLUG//\// });
        REPO_NAME=${REPO_SLUG_ARRAY[1]};
        URL="https://${REPO_NAME}.mate-desktop.dev";
        COMMENT="Code analysis completed";
        curl -H "Authorization: token $GITHUB_TOKEN" -X POST
           -d "{\"state\": \"success\", \"description\": \"$COMMENT\", \"context\":\"scan-build\", \"target_url\": \"$URL\"}"
           https://api.github.com/repos/${TRAVIS_REPO_SLUG}/statuses/${TRAVIS_PULL_REQUEST_SHA};
     fi'

env:
#  - DISTRO="archlinux:latest"
  - DISTRO="debian:testing"
  - DISTRO="fedora:latest"
#  - DISTRO="ubuntu:rolling"