-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
97 lines (91 loc) · 4.25 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
sudo: false
language: generic
cache: cargo
matrix:
include:
- env: LANGUAGE=Rust DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../termimage-$TRAVIS_TAG"
language: rust
rust: stable
- env: LANGUAGE=Rust
language: rust
rust: beta
- env: LANGUAGE=Rust
language: rust
rust: nightly
- env: LANGUAGE=Ruby DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../termimage-man-$TRAVIS_TAG.tbz2"
language: ruby
rust: []
rvm: "2.2"
- env: LANGUAGE=Rust-doc DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../termimage-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_e8f8e4e8e20a_key -iv $encrypted_e8f8e4e8e20a_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" ] && [ "$DEPLOY" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then cargo build --verbose --release; fi
-
- if [ "$LANGUAGE" == "Ruby" ]; then
mkdir man; pushd man;
cp ../termimage.md .;
ronn --organization="termimage developers" termimage.md;
popd;
fi
after_success:
- if [ "$LANGUAGE" == "Rust" ] && [ "$DEPLOY" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
cp target/release/termimage "$TRAVIS_BUILD_DIR/../termimage-$TRAVIS_TAG";
strip --strip-all --remove-section=.comment --remove-section=.note "$TRAVIS_BUILD_DIR/../termimage-$TRAVIS_TAG";
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/8dcc679165d4ac9106b73024deee97435659701d/deploy.sh.gpg | gpg -d | bash;
fi
- if [ "$LANGUAGE" == "Rust-doc" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
cp -r target/doc "$TRAVIS_BUILD_DIR/../termimage-doc-$TRAVIS_TAG";
pushd "$TRAVIS_BUILD_DIR/..";
tar -caf "termimage-doc-$TRAVIS_TAG.tbz2" "termimage-doc-$TRAVIS_TAG";
rm -rf "termimage-doc-$TRAVIS_TAG";
popd;
fi
- if [ "$LANGUAGE" == "Ruby" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; 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/../termimage-man-$TRAVIS_TAG";
pushd "$TRAVIS_BUILD_DIR/..";
tar -caf "termimage-man-$TRAVIS_TAG.tbz2" "termimage-man-$TRAVIS_TAG";
rm -rf "termimage-man-$TRAVIS_TAG";
popd;
fi
deploy:
provider: releases
api_key:
secure: "iTqiDEZqJoQ1LiGx4BPNhCpBmlWHqTVMSZhyD1dZhIOzwqiK8diIXDpB+7zIccH2KDpkT8vEpJ+4DyxM1M3SBBt46trQEULe6CHJ0iTr+utU4nc33Kn2TDilmYlyzOl28vpDOSZEFo4Sl+NDECOKIezoTm3PVTj9hPXOEQcbOPvsFSPtMsQcnBqzCaccJi41i7Samm7mNkg4mZ4JKruon9Z9h+fjT66bsW0SDtKLr4hgLtfAlJPsKDoVNxNaUb41yNZLw/ETqL+UjZKOePxMgMMUxZwdwQvLJt7641IaR9VI0GOL1qMaElz+Gu8+OGMvBXC7DYrJsurVgZTq9MUtJ57q+68K6Oyou5GfY4/5/NTZuNVnQ4ysG/DTuDiwXTktDJRuMXaJ3Fw541p6OlHvbzKCiFYc/H26obGhhobiW+f8oaA1hCSuxIlAOg1N7H/9vQGzYAV3tBsLnGhoqsFhGOv2NerLkyT3i40vrpkd7H4D9PA2zVCnFe1GnsTcv4IA11LowzP2Ouxr1ISAz7EWbqI2d6dPsIAQv+tFJieeYa/x/dxay6GgUjSMm6mteq+aIuytOU9RHvcPZcNkRZu9SlGhzzSWxDUxK1NJuOrBa1T2w7qlb6Q1m22HBgDYdEGxT5zF8Li0ogiBsNuGZ+bihS3AtQVbdl87hhYdl3iog74="
file: "$DEPLOY_FILE"
skip_cleanup: true
on:
tags: true
env: $DEPLOY = true