@@ -22,36 +22,51 @@ matrix:
2222 # These builds always run. PRs, master, staging, stable, etc.
2323 - &linuxalways
2424 os : linux
25- env : TARGET=x86_64-unknown-linux-gnu NO_ADD=1
25+ env : TARGET=x86_64-unknown-linux-gnu NO_ADD=1 DO_SNAP=1 SNAP_ARCH=amd64
26+ addons : &snapaddon
27+ snaps :
28+ - name : snapcraft
29+ channel : stable
30+ confinement : classic
31+
2632 # Most builds consuming this only run on the stable and staging branches
2733 - &linuxstable
2834 os : linux
29- env : TARGET=i686-unknown-linux-gnu
35+ env : TARGET=i686-unknown-linux-gnu DO_SNAP=1 SNAP_ARCH=i386
3036 if : branch != master
37+ addons :
38+ << : *snapaddon
39+
3140 # These builds run on non-pull-requests, so master, staging, stable...
3241 - &linuxmaster
3342 os : linux
34- env : SKIP_TESTS=1 TARGET=aarch64-unknown-linux-gnu
43+ env : SKIP_TESTS=1 TARGET=aarch64-unknown-linux-gnu DO_SNAP=1 SNAP_ARCH=arm64
3544 if : type != pull_request
45+ addons :
46+ << : *snapaddon
3647
3748 # Cross builds happen in the `rust-slave-linux-cross` image to ensure that
3849 # we use the right cross compilers for these targets. That image should
3950 # bundle all the gcc cross compilers to enable us to build OpenSSL
51+
4052 # Builds which occur only on stable (and staging branches) take linuxstable
4153 # Those which occur on master or any other branch (but not PRs) linuxmaster
4254 # And those which run always (PRs, master, staging, etc) linuxalways
4355 - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=arm-unknown-linux-gnueabi }
4456 - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=arm-unknown-linux-gnueabihf }
45- - { <<: *linuxalways, env: SKIP_TESTS=1 TARGET=armv7-unknown-linux-gnueabihf }
57+ - << : *linuxmaster
58+ env : SKIP_TESTS=1 TARGET=armv7-unknown-linux-gnueabihf DO_SNAP=1 SNAP_ARCH=armhf
4659 - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=x86_64-unknown-freebsd }
4760 - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=powerpc-unknown-linux-gnu }
4861 - { <<: *linuxmaster, env: SKIP_TESTS=1 TARGET=powerpc64-unknown-linux-gnu }
49- - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=powerpc64le-unknown-linux-gnu }
62+ - << : *linuxmaster
63+ env : SKIP_TESTS=1 TARGET=powerpc64le-unknown-linux-gnu DO_SNAP=1 SNAP_ARCH=ppc64el
5064 - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=mips-unknown-linux-gnu }
5165 - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=mipsel-unknown-linux-gnu }
5266 - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=mips64-unknown-linux-gnuabi64 }
5367 - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=mips64el-unknown-linux-gnuabi64 }
54- - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=s390x-unknown-linux-gnu }
68+ - << : *linuxmaster
69+ env : SKIP_TESTS=1 TARGET=s390x-unknown-linux-gnu DO_SNAP=1 SNAP_ARCH=s390x
5570 - { <<: *linuxmaster, env: SKIP_TESTS=1 TARGET=x86_64-unknown-linux-musl }
5671 - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=arm-linux-androideabi }
5772 - { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=armv7-linux-androideabi }
@@ -132,6 +147,14 @@ script:
132147
133148before_deploy :
134149 - sh ci/prepare-deploy-travis.sh
150+ - |
151+ if [ -n "$DO_SNAP" ]; then
152+ if [ "$TRAVIS_BRANCH" != "stable" ]; then
153+ export SNAP_EDGE=1
154+ fi
155+ sh ci/snapcraft.sh
156+ export SNAP_NAME=snapcraft/$(cat snap/snap-name)
157+ fi
135158
136159deploy :
137160 - provider : s3
@@ -145,3 +168,17 @@ deploy:
145168 secret_access_key : $AWS_SECRET_ACCESS_KEY
146169 on :
147170 branch : stable
171+ - provider : snap
172+ snap : $SNAP_NAME
173+ channel : beta
174+ skip_cleanup : true
175+ on :
176+ branch : stable
177+ condition : $DO_SNAP = 1
178+ - provider : snap
179+ snap : $SNAP_NAME
180+ channel : edge
181+ skip_cleanup : true
182+ on :
183+ branch : master
184+ condition : $DO_SNAP = 1
0 commit comments