forked from svenstaro/genact
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
82 lines (74 loc) · 2.75 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
81
82
language: rust
rust:
- stable
- beta
- nightly
addons:
apt:
packages:
- mingw-w64
- upx
matrix:
allow_failures:
- rust: nightly
include:
- env:
- TARGET=x86_64-unknown-linux-musl
- BIN_NAME=genact
- PROPER_NAME=genact-linux
os: linux
- env:
- TARGET=x86_64-pc-windows-gnu
- BIN_NAME=genact.exe
- PROPER_NAME=genact-win.exe
- RUSTFLAGS="-C linker=x86_64-w64-mingw32-gcc"
os: linux
- env:
- TARGET=x86_64-apple-darwin
- BIN_NAME=genact
- PROPER_NAME=genact-osx
os: osx
- env:
- TARGET=wasm32-unknown-emscripten
- BIN_NAME=genact
- PROPER_NAME=genact-web
os: linux
before_install:
- rustup self update
# Force installation of cargo-web because there might be an update.
- if [[ $TARGET = "wasm32-unknown-emscripten" ]]; then cargo install --force cargo-web; fi
install:
# On Apple, the default target is already the right one.
- if [[ -n $TARGET && $TARGET != "x86_64-apple-darwin" ]]; then rustup target add $TARGET; fi
script:
# If this is a normal, non-deployment build...
- if [[ -z $TARGET ]]; then cargo build --verbose; fi
# If this is a deployment build but not for the web...
- if [[ -n $TARGET && $TARGET != "wasm32-unknown-emscripten" ]]; then cargo build --verbose --release --target $TARGET; fi
# If this is a deployment build for the web...
- if [[ $TARGET = "wasm32-unknown-emscripten" ]]; then travis_wait 30 cargo web deploy --verbose --release; fi
before_deploy:
# If this is a binary deployment...
- if [[ -n $TARGET && $TARGET != "wasm32-unknown-emscripten" ]]; then cp -a target/$TARGET/release/$BIN_NAME $PROPER_NAME && strip $PROPER_NAME; fi
- # Run upx on the binary if this is a deployment for Linux or Windows
- if [[ $TARGET = "x86_64-pc-windows-gnu" ]]; then upx $PROPER_NAME; fi
- if [[ $TARGET = "x86_64-unknown-linux-musl" ]]; then upx $PROPER_NAME; fi
deploy:
- provider: releases
api_key:
secure: "n1OCiCjupkVieqsepGBOk6oxGcU89n9z0lQWWMAtBKREIEL1fnqt7A4z9FC1LV9UiAwvcvMHI8As5TA/7sV6jiWFuNOqu5HurX/n7cXlAuVWx00gCtWZ7Fh14ipVIDr2W52Mj/5qw1LSW19g8+9nLF1xO2YLrNpiaQX+V6Ypf04="
file: $PROPER_NAME
skip_cleanup: true
on:
branch: master
tags: true
condition: $TRAVIS_RUST_VERSION = stable && -n $TARGET && $TARGET != "wasm32-unknown-emscripten"
- provider: pages
local_dir: target/deploy
skip_cleanup: true
github_token:
secure: "n1OCiCjupkVieqsepGBOk6oxGcU89n9z0lQWWMAtBKREIEL1fnqt7A4z9FC1LV9UiAwvcvMHI8As5TA/7sV6jiWFuNOqu5HurX/n7cXlAuVWx00gCtWZ7Fh14ipVIDr2W52Mj/5qw1LSW19g8+9nLF1xO2YLrNpiaQX+V6Ypf04="
on:
branch: master
tags: true
condition: $TRAVIS_RUST_VERSION = stable && $TARGET = "wasm32-unknown-emscripten"