forked from anowell/mia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
80 lines (71 loc) · 2.31 KB
/
.travis.yml
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
language: rust
cache: cargo
dist: trusty
addons:
apt:
packages:
- fakeroot
env:
global:
- PROJECT_NAME=algorithmia
matrix:
include:
- os: osx
env: RUST_VERSION=stable
TARGET=x86_64-apple-darwin
MACOSX_DEPLOYMENT_TARGET=10.7
FEATURES=default
- os: linux
env: RUST_VERSION=stable
TARGET=x86_64-unknown-linux-gnu
DOCKER_BUILD=yes
MAKE_DEB=yes
FEATURES=rust-tls
sudo: required
services:
- docker
- os: linux
env: TARGET=x86_64-unknown-linux-gnu
FEATURES=rust-tls
install:
- curl https://static.rust-lang.org/rustup.sh |
sh -s -- --disable-sudo --prefix=$HOME/rust --spec=$RUST_VERSION --with-target=$TARGET
script:
- mkdir -p target
- if [ ! -z "$DOCKER_BUILD" ]; then
docker build --build-arg TARGET=$TARGET --build-arg FEATURES=$FEATURES -t "algo-cli" .;
docker run
--entrypoint bash
-u `id -u`:`id -g`
-v `pwd`:/buildslave
-it algo-cli
-c "cp -r /cli/target /buildslave/.";
else
PATH=$HOME/rust/bin:$PATH sh ci/run.sh;
fi
before_deploy:
- bash ci/prepare_deploy.sh
deploy:
provider: releases
# Regenerate this api_key for your project, this one won't work for you. Here's how:
# - Go to 'https://github.com/settings/tokens/new' and generate a Token with only the
# `public_repo` scope enabled
# - Call `travis encrypt $github_token` where $github_token is the token you got in the previous
# step and `travis` is the official Travis CI gem (see https://rubygems.org/gems/travis/)
# - Enter the "encrypted value" below
# Note: this is a personal access token generated by anowell
api_key:
secure: "iVBdT0NgpPZFfyfkykTlRKitK8zjWCnH+NilbWfdXHtQPIEht8Q8fkIS65B9UEKtmfHNaxpINAQSuInSm7PfUshAnilAVaMZ62A/o9tE+JLcR8fWpx6+xYIsgI/CE5J69R/IMpPS6WrKXdRc4qXiLYWAX36AK0bMeZjfGgPQDPc="
file_glob: true
file: ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.*
skip_cleanup: true
on:
condition: $RUST_VERSION = stable
tags: true
branches:
only:
# Pushes and PR to the master branch
- master
# IMPORTANT Ruby regex to match tags. Required, or travis won't trigger deploys when a new tag
# is pushed. This regex matches semantic versions like v1.2.3-rc4+2016.02.22
- /^v\d+\.\d+\.\d+.*$/