|
| 1 | +# Based on the "trust" template v0.1.1 |
| 2 | +# https://github.com/japaric/trust/tree/v0.1.1 |
| 3 | + |
| 4 | +dist: trusty |
1 | 5 | language: rust
|
2 |
| -cache: cargo |
| 6 | +services: docker |
| 7 | +sudo: required |
| 8 | + |
| 9 | +# TODO Rust builds on stable by default, this can be |
| 10 | +# overridden on a case by case basis down below. |
3 | 11 |
|
4 | 12 | env:
|
5 | 13 | global:
|
6 |
| - - PROJECT_NAME=tokei |
| 14 | + - CRATE_NAME=tokei |
7 | 15 | - MAKE_DEB=yes
|
8 | 16 | - DEB_MAINTAINER="Aaron Power <[email protected]>"
|
9 | 17 | - DEB_DESCRIPTION="A utility that allows you to count code, quickly."
|
10 | 18 |
|
11 |
| -# AFAICT There are a few ways to set up the build jobs. This one is not the |
12 |
| -# DRYest but I feel is the easiest to reason about. |
13 |
| -# TODO Feel free to remove the channels/targets you don't need |
14 |
| -# NOTE Make *sure* you don't remove a reference (&foo) if you are going to dereference it (*foo) |
15 | 19 | matrix:
|
| 20 | + # TODO These are all the build jobs. Adjust as necessary. Comment out what you |
| 21 | + # don't need |
16 | 22 | include:
|
17 |
| - # Stable channel |
18 |
| - - os: osx |
19 |
| - rust: stable |
20 |
| - env: TARGET=i686-apple-darwin |
21 |
| - - os: linux |
22 |
| - rust: stable |
23 |
| - env: TARGET=i686-unknown-linux-gnu |
24 |
| - addons: |
25 |
| - apt: |
26 |
| - packages: &i686_unknown_linux_gnu |
27 |
| - # Cross compiler and cross compiled C libraries |
28 |
| - - gcc-multilib |
29 |
| - - os: linux |
30 |
| - rust: stable |
31 |
| - env: TARGET=i686-unknown-linux-musl |
32 |
| - dist: trusty |
33 |
| - sudo: required |
34 |
| - addons: |
35 |
| - apt: |
36 |
| - packages: &musl_packages |
37 |
| - - musl |
38 |
| - - musl-dev |
39 |
| - - musl-tools |
40 |
| - - os: osx |
41 |
| - rust: stable |
42 |
| - env: TARGET=x86_64-apple-darwin |
43 |
| - - os: linux |
44 |
| - rust: stable |
45 |
| - env: TARGET=x86_64-unknown-linux-gnu |
46 |
| - - os: linux |
47 |
| - rust: stable |
48 |
| - env: TARGET=x86_64-unknown-linux-musl |
49 |
| - dist: trusty |
50 |
| - sudo: required |
51 |
| - addons: |
52 |
| - apt: |
53 |
| - packages: *musl_packages |
54 |
| - # Beta channel |
55 |
| - - os: osx |
56 |
| - rust: beta |
57 |
| - env: TARGET=i686-apple-darwin |
58 |
| - - os: linux |
59 |
| - rust: beta |
60 |
| - env: TARGET=i686-unknown-linux-gnu |
61 |
| - addons: |
62 |
| - apt: |
63 |
| - packages: *i686_unknown_linux_gnu |
64 |
| - - os: linux |
65 |
| - rust: beta |
66 |
| - env: TARGET=i686-unknown-linux-musl |
67 |
| - dist: trusty |
68 |
| - sudo: required |
69 |
| - addons: |
70 |
| - apt: |
71 |
| - packages: *musl_packages |
72 |
| - - os: osx |
73 |
| - rust: beta |
74 |
| - env: TARGET=x86_64-apple-darwin |
75 |
| - - os: linux |
76 |
| - rust: beta |
77 |
| - env: TARGET=x86_64-unknown-linux-gnu |
78 |
| - - os: linux |
79 |
| - rust: beta |
80 |
| - env: TARGET=x86_64-unknown-linux-musl |
81 |
| - dist: trusty |
82 |
| - sudo: required |
83 |
| - addons: |
84 |
| - apt: |
85 |
| - packages: *musl_packages |
86 |
| - # Nightly channel |
87 |
| - - os: osx |
88 |
| - rust: nightly |
89 |
| - env: TARGET=i686-apple-darwin |
90 |
| - - os: linux |
91 |
| - rust: nightly |
92 |
| - env: TARGET=i686-unknown-linux-gnu |
93 |
| - addons: |
94 |
| - apt: |
95 |
| - packages: *i686_unknown_linux_gnu |
96 |
| - - os: linux |
97 |
| - rust: nightly |
98 |
| - env: TARGET=i686-unknown-linux-musl |
99 |
| - dist: trusty |
100 |
| - sudo: required |
101 |
| - addons: |
102 |
| - apt: |
103 |
| - packages: *musl_packages |
104 |
| - - os: osx |
105 |
| - rust: nightly |
106 |
| - env: TARGET=x86_64-apple-darwin |
107 |
| - - os: linux |
| 23 | + # Linux |
| 24 | + - env: TARGET=i686-unknown-linux-gnu |
| 25 | + - env: TARGET=i686-unknown-linux-musl |
| 26 | + - env: TARGET=x86_64-unknown-linux-gnu |
| 27 | + - env: TARGET=x86_64-unknown-linux-musl |
| 28 | + |
| 29 | + # OSX |
| 30 | + - env: TARGET=i686-apple-darwin |
| 31 | + os: osx |
| 32 | + - env: TARGET=x86_64-apple-darwin |
| 33 | + os: osx |
| 34 | + |
| 35 | + # *BSD |
| 36 | + - env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1 |
| 37 | + - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1 |
| 38 | + - env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1 |
| 39 | + |
| 40 | + # Other architectures |
| 41 | + - env: TARGET=aarch64-unknown-linux-gnu |
| 42 | + - env: TARGET=armv7-unknown-linux-gnueabihf |
| 43 | + - env: TARGET=mips-unknown-linux-gnu |
| 44 | + - env: TARGET=mips64-unknown-linux-gnuabi64 |
| 45 | + - env: TARGET=mips64el-unknown-linux-gnuabi64 |
| 46 | + - env: TARGET=mipsel-unknown-linux-gnu |
| 47 | + - env: TARGET=powerpc-unknown-linux-gnu |
| 48 | + - env: TARGET=powerpc64-unknown-linux-gnu |
| 49 | + - env: TARGET=powerpc64le-unknown-linux-gnu |
| 50 | + - env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1 |
| 51 | + |
| 52 | + # Testing other channels |
| 53 | + - env: TARGET=x86_64-unknown-linux-gnu |
108 | 54 | rust: nightly
|
109 |
| - env: TARGET=x86_64-unknown-linux-gnu |
110 |
| - - os: linux |
| 55 | + - env: TARGET=x86_64-apple-darwin |
| 56 | + os: osx |
111 | 57 | rust: nightly
|
112 |
| - env: TARGET=x86_64-unknown-linux-musl |
113 |
| - dist: trusty |
114 |
| - sudo: required |
115 |
| - addons: |
116 |
| - apt: |
117 |
| - packages: *musl_packages |
118 | 58 | allow_failures:
|
119 |
| - - rust: nightly |
120 |
| -before_install: |
121 |
| - - export PATH="$PATH:$HOME/.cargo/bin" |
| 59 | + - rust: nightly |
| 60 | + |
| 61 | +before_install: set -e |
122 | 62 |
|
123 | 63 | install:
|
124 |
| - - bash ci/install.sh |
| 64 | + - sh ci/install.sh |
| 65 | + - source ~/.cargo/env || true |
125 | 66 |
|
126 | 67 | script:
|
127 | 68 | - bash ci/script.sh
|
128 | 69 |
|
| 70 | +after_script: set +e |
| 71 | + |
129 | 72 | before_deploy:
|
130 |
| - - bash ci/before_deploy.sh |
| 73 | + - sh ci/before_deploy.sh |
131 | 74 |
|
132 | 75 | deploy:
|
133 |
| - provider: releases |
| 76 | + # TODO update `api_key.secure` |
| 77 | + # - Create a `public_repo` GitHub token. Go to: https://github.com/settings/tokens/new |
| 78 | + # - Encrypt it: `travis encrypt 0123456789012345678901234567890123456789 |
| 79 | + # - Paste the output down here |
134 | 80 | api_key:
|
135 | 81 | secure: JAWZDa7izxqh/013aqxwSxhu4wndJfvQWngA/DMutC5J5ZTUEmA0UJG+VGCVcMVZOBu/IUy6tRmz3IgEqgW74FLc4UuBRH3RdInp+dpjUc2yTuUltOuT+skn5LGQXi+m8VeIxRS0PXCsN5twpOfSi0uuKu+UzMN9ZOX9wEy1svRlAUJdcT37LfvlS/lnxHoF+WuakZfFsP0QCrgI7uBY83X+wT6YAixiywzadKMqXDSNlJ7m0t9pJ1FsR0BgnoYiTI/L/3P3FDJCDzShujlU9P3xLvirV4/HB9NPG+IhuhTSCpBE8UIzCourAi6AgG3wdQGiR9S9QdwEuF3Y5Ya5l2tkJpqrk8FkBMVkH57m9iGV0j4mHDOvaRzMiPyYeuTTPKgbSWAvLOGouVRDP0SrZGjjcCvKSN4LVgO83uLjsg2XtdFoA89s/pNLsY2e07trT6jVm12P9uKdLWqkHdLJdGG4448aL8cIXntlCIHujpSmSikGtlGZZB6cvfkZQn/ZLhBxiGyk8n2V5hpqFml/tk6QDxyY04gSd1t/9aebOZmAGFYP0aufJpQe1GW13PQSdIQL6MZPtsk88OgP6EqUOSBCIAWuBd0cLds1SE+TELPyAPHWx5Z/y+mUEx4NoxRWWzNbQxOaMfXtLhE+xp7gdJYH7QtldagYz79UX/8wYbo=
|
136 | 82 | file_glob: true
|
137 |
| - file: ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.* |
138 |
| - # don't delete the artifacts from previous phases |
139 |
| - skip_cleanup: true |
140 |
| - # deploy when a new tag is pushed |
| 83 | + file: $CRATE_NAME-$TRAVIS_TAG-$TARGET.* |
141 | 84 | on:
|
| 85 | + # TODO Here you can pick which targets will generate binary releases |
| 86 | + # In this example, there are some targets that are tested using the stable |
| 87 | + # and nightly channels. This condition makes sure there is only one release |
| 88 | + # for such targets and that's generated using the stable channel |
142 | 89 | condition: $TRAVIS_RUST_VERSION = stable
|
143 | 90 | tags: true
|
| 91 | + provider: releases |
| 92 | + skip_cleanup: true |
| 93 | + |
| 94 | +cache: cargo |
| 95 | +before_cache: |
| 96 | + # Travis can't cache files that are not readable by "others" |
| 97 | + - chmod -R a+r $HOME/.cargo |
144 | 98 |
|
145 | 99 | branches:
|
146 | 100 | only:
|
147 |
| - # Pushes and PR to the master branch |
148 |
| - - master |
149 |
| - # IMPORTANT Ruby regex to match tags. Required, or travis won't trigger deploys when a new tag |
150 |
| - # is pushed. This regex matches semantic versions like v1.2.3-rc4+2016.02.22 |
| 101 | + # release tags |
151 | 102 | - /^v\d+\.\d+\.\d+.*$/
|
| 103 | + - master |
152 | 104 |
|
153 | 105 | notifications:
|
154 | 106 | email:
|
|
0 commit comments