-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
68 lines (63 loc) · 1.86 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
language: rust
sudo: required
services: docker
cache: cargo
before_cache:
- rm -rf "$TRAVIS_HOME/.cargo/registry/src"
DEPLOY_TO_GITHUB: &DEPLOY_TO_GITHUB
before_deploy:
- git config --local user.name "Helium CI"
- git config --local user.email "hello@helium.com"
- name="helium-console-cli-$TRAVIS_TAG-$TARGET"
- mkdir $name
- cp target/$TARGET/release/helium-console-cli$EXE $name/
- cp LICENSE $name/
- cp README.md $name/
- zip -r $name.zip $name
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file: helium-console-cli-$TRAVIS_TAG-$TARGET.zip
skip_cleanup: true
on:
branch: master
tags: true
matrix:
include:
- name: Linux Binary
env: TARGET=x86_64-unknown-linux-gnu
rust: stable
before_script:
- rustup target add $TARGET
- rustup component add rustfmt
- rustup component add clippy
script:
- cargo fmt -- --check
- cargo build --release --target $TARGET --locked
- cargo clippy -- --deny=clippy::all
<<: *DEPLOY_TO_GITHUB
- name: macOS Binary
env: MACOSX_DEPLOYMENT_TARGET=10.7 TARGET=x86_64-apple-darwin
os: osx
rust: stable
before_script:
- rustup target add $TARGET
- rustup component add rustfmt
- rustup component add clippy
script:
- cargo fmt -- --check
- cargo build --release --target $TARGET --locked
- cargo clippy -- --deny=clippy::all
<<: *DEPLOY_TO_GITHUB
- name: Windows Binary
env: TARGET=x86_64-pc-windows-gnu EXE=.exe
rust: stable
before_script:
- rustup target add $TARGET
- rustup component add rustfmt
- rustup component add clippy
script:
- cargo fmt -- --check
- RUSTFLAGS="-C linker=x86_64-w64-mingw32-gcc" cargo build --release --target $TARGET --locked
- cargo clippy -- --deny=clippy::all
<<: *DEPLOY_TO_GITHUB