forked from nabijaczleweli/openalias.rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
106 lines (100 loc) · 4.55 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
sudo: false
language: generic
cache:
cargo: true
matrix:
include:
- env: LANGUAGE=Rust DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../openalias-$TRAVIS_TAG"
language: rust
rust: stable
- env: LANGUAGE=Rust
language: rust
rust: beta
- env: LANGUAGE=Rust CLIPPY=true
language: rust
rust: nightly
- env: LANGUAGE=Ruby DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../openalias.rs-man-$TRAVIS_TAG.tbz2"
language: ruby
rust: []
rvm: "2.2"
- env: LANGUAGE=Rust-doc DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../openalias.rs-doc-$TRAVIS_TAG.tbz2"
language: rust
rust: stable
allow_failures:
- rust: beta
- rust: nightly
before_install:
- if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
openssl aes-256-cbc -K $encrypted_53aa6cbbcdc9_key -iv $encrypted_53aa6cbbcdc9_iv -in gh_rsa.enc -out gh_rsa -d;
fi
install:
- if [ "$LANGUAGE" == "Ruby" ]; then gem install ronn; fi
script:
- if [ "$LANGUAGE" == "Rust" ]; then cargo build --verbose; fi
- if [ "$LANGUAGE" == "Rust" ]; then cargo test --verbose; fi
- if [ "$LANGUAGE" == "Rust" ] && [ "$CLIPPY" ]; then
cargo install clippy cargo-update;
cargo install-update -a;
cargo clippy;
fi
- if [ "$LANGUAGE" == "Rust" ] && [ "$DEPLOY" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then cargo build --verbose --release; fi
-
- if [ "$LANGUAGE" == "Ruby" ]; then
mkdir man;
cp openalias.rs.md man/;
ronn --organization="openalias.rs developers" man/*.md;
fi
after_success:
- if [ "$LANGUAGE" == "Rust" ] && [ "$DEPLOY" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
cp target/release/openalias "$TRAVIS_BUILD_DIR/..";
pushd "$TRAVIS_BUILD_DIR/..";
strip --strip-all --remove-section=.comment --remove-section=.note openalias;
tar -caf "openalias-$TRAVIS_TAG" openalias;
popd;
fi
- if [ "$LANGUAGE" == "Rust-doc" ]; then
curl -SL https://keybase.io/nabijaczleweli/key.asc | gpg --import;
curl -SL https://gist.github.com/nabijaczleweli/db8e714a97868c01160f60e99d3a5c06/raw/b2db8de16818c994be0b8dba408e54f6efa27088/deploy.sh.gpg | gpg -d | bash;
fi
- if [ "$LANGUAGE" == "Rust-doc" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
cargo doc;
cp -r target/doc "$TRAVIS_BUILD_DIR/../openalias.rs-doc-$TRAVIS_TAG";
pushd "$TRAVIS_BUILD_DIR/..";
tar -caf "openalias.rs-doc-$TRAVIS_TAG.tbz2" "openalias.rs-doc-$TRAVIS_TAG";
rm -rf "openalias.rs-doc-$TRAVIS_TAG";
popd;
fi
- if [ "$LANGUAGE" == "Ruby" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ] && [ "$TRAVIS_COMMIT_RANGE" ] && ! [ "$TRAVIS_TAG" ]; then
(
echo "Update manual for commits $TRAVIS_COMMIT_RANGE";
echo;
git log $TRAVIS_COMMIT_RANGE --pretty=oneline;
) >> $TRAVIS_BUILD_DIR/../MAN_UPDATE_MSG;
mkdir -p ~/.ssh && cp gh_rsa ~/.ssh/id_rsa && chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa;
git clone -b man [email protected]:$TRAVIS_REPO_SLUG.git "$TRAVIS_BUILD_DIR-man";
cp -f man/* "$TRAVIS_BUILD_DIR-man";
pushd "$TRAVIS_BUILD_DIR-man";
git config --global user.email "[email protected]";
git config --global user.name "Nabijaczleweli Autouploader Bot";
git config --global push.default simple;
git add *;
git commit -F $TRAVIS_BUILD_DIR/../MAN_UPDATE_MSG;
git push;
popd;
fi
- if [ "$LANGUAGE" == "Ruby" ] && [ "$TRAVIS_TAG" ]; then
cp -r man "$TRAVIS_BUILD_DIR/../openalias.rs-man-$TRAVIS_TAG";
pushd "$TRAVIS_BUILD_DIR/..";
tar -caf "openalias.rs-man-$TRAVIS_TAG.tbz2" "openalias.rs-man-$TRAVIS_TAG";
rm -rf "openalias.rs-man-$TRAVIS_TAG";
popd;
fi
deploy:
provider: releases
api_key:
secure: "qQ5FJO2M8KQ330iadX5Ce6ErB+I2Xi/2crwKcznwbVh5GqgsiZhkFLwsZKBdK8HHewFlP/6ZBevNArdJOhMriqkJ5lWPs9lBLy6spqXM52zZqmVdNRGGlVc4/4vKSzBOJQFDIS3mL8TIoT+PtfDVvHK09GhP4RH678o3nloHz18wuAJfFGY8FL7+BxwW6Y9dLrOCzRO52XJ0Kl5Igj397bhhYZu4NGA5eMVKZxJjXYXY3IC2a/aMUnwlvm4BeGnauCaajJ6x4MEKP6en4nr7ovQQ503Un7ppr8toYG9y5NGVF/KIerJQ/DaBx+dHSLwCeMdi5EOv+fpxgikv/LHSvSCaAeHQe8bk/ddyNp6paUaeDUJlL7uNsFSi0zytVREwYSi6zfY+al7gvx1+qpM4Wb1CwRYjfWYXfJl+e0+59BU5uqw2dC3WacImlATVSiIQpDCAmXSkaB8hu5fIG+oxgPGmDU6XN7OA8WhtKV0xdxPFU9KSWPwS8QluoCjFbNqVJST7jeoFNIuIJM5AJ9VgG+RolnBnDG6o0YKq4jteOikf7hlI9X/ZzNdiT210J0TSjpYwYkWdl81/orlyG3cw33x6H4BiZrGPC5UJs8jr8dpCGKhdF670HNLi4f/S/o3pxzOe6W/0AnSv8DgKCa8E3atOK/wDC/9mdus+wqtOB2Q="
file: "$DEPLOY_FILE"
skip_cleanup: true
on:
tags: true
env: $DEPLOY = true