-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
68 lines (57 loc) · 2.78 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
os:
- linux
- osx
rust:
- stable
script: |
set -e
release=0
target=
version=
tag="$(git name-rev --name-only HEAD)"
if [[ "$tag" == tags/v* ]]; then
release=1
version="$(sed 's/^tags\/v//' <<< $tag)"
fi
if [ "$release" = 1 ]; then
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
rustup target add x86_64-unknown-linux-musl
target='--target x86_64-unknown-linux-musl'
fi
sed "s/^version = \"0.0.1\"$/version = \"$version\"/" Cargo.toml > Cargo.toml.new
mv Cargo.toml.new Cargo.toml
cat Cargo.toml
git add -A
git commit -m "version $version"
fi
rustup component add rustfmt-preview
cargo fmt && git diff --quiet
cargo build $target --release
cargo test $target --release
mkdir target/upload
if [ "$release" = 1 ]; then
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
cp target/x86_64-unknown-linux-musl/release/fsw target/upload/fsw-linux-amd64
elif [ "$TRAVIS_OS_NAME" = 'osx' ]; then
cp target/release/fsw target/upload/fsw-darwin-amd64
elif [ "$TRAVIS_OS_NAME" = 'windows' ]; then
cp target/release/fsw.exe target/upload/fsw-windows.exe
fi
if [ "$CRATES_API_KEY" != '' ] && [ "$TRAVIS_OS_NAME" = 'linux' ]; then
cargo login "$CRATES_API_KEY"
cargo publish
fi
fi
env:
global:
secure: "Ub9/Xb6UR51Z6YM+uo5PycOW6P+gkm6q+X1VOQKFugAHba0Dp92GY9jqLz9oPj7vG7nakURdH+FsmK3M6t/LNHFhEcvXjCnhunti173IP4FD7QlbVtIlCSS5YqS65/18vKYN7ewXLPJapFcCE29f7lqbtfV/D+9zgS5WVj8FsciIcmsh+IbF9dBLem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K3XhzLEqPuxb4XzWkJrpv7LgwEj8iIax+nzufoY4l7+mceBb6IaIFmHt8GEIpKylk37wZCPlcMa5KnsXbYT7vFhUD/cZsLASnIaaO9oELIZ17XIfdBXJaFMu6I996nULPO43p8=
skip_cleanup: true
file_glob: true
file: target/upload/*
on:
tags: true