-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
153 lines (146 loc) · 6.38 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
sudo: false
language: generic
cache:
cargo: true
apt: true
directories:
- /tmp/tools
env:
global:
- PATH="$HOME/bin:$PATH"
- CMAKE_VERSION_PREFIX=3.7
- CMAKE_VERSION_FULL=3.7.2
matrix:
include:
- env: LANGUAGE=Rust DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../pir-8-emu-$TRAVIS_TAG.tbz2"
language: rust
rust: stable
addons:
apt:
packages: &packages
- libx11-dev
- libxmu-dev
- libgl1-mesa-dev
sources: &sources
- r-packages-trusty
- env: LANGUAGE=Rust
language: rust
rust: beta
addons:
apt:
packages: *packages
sources: *sources
- env: LANGUAGE=Rust CLIPPY=true
language: rust
rust: nightly
addons:
apt:
packages: *packages
sources: *sources
- env: LANGUAGE=Ruby DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../pir-8-emu-man-$TRAVIS_TAG.tbz2"
language: ruby
rust: []
rvm: "2.2"
- env: LANGUAGE=Rust-doc DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../pir-8-emu-doc-$TRAVIS_TAG.tbz2"
language: rust
rust: stable
addons:
apt:
packages: *packages
sources: *sources
allow_failures:
- rust: beta
- rust: nightly
before_install:
- if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
openssl aes-256-cbc -K $encrypted_17996de16c26_key -iv $encrypted_17996de16c26_iv -in gh_rsa.enc -out gh_rsa -d;
fi
install:
- if [ "$LANGUAGE" == "Ruby" ]; then gem install ronn; fi
-
- if [ "$CLIPPY" ]; then
CLIPPY_INSTALLED=0 && (rustup component add clippy-preview || cargo install --git https://github.com/rust-lang/rust-clippy clippy -f) && CLIPPY_INSTALLED=1;
fi
-
- if [ "$LANGUAGE" == "Rust" ] || [ "$LANGUAGE" == "Rust-doc" ]; then
mkdir -p /tmp/tools && pushd /tmp/tools;
if [[ ! -f "cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh" ]]; then
curl -SOL "https://cmake.org/files/v$CMAKE_VERSION_PREFIX/cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh";
chmod +x "cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh";
fi;
./"cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh" --prefix="$HOME" --exclude-subdir --skip-license;
popd;
fi
- if [ "$LANGUAGE" == "Rust" ] || [ "$LANGUAGE" == "Rust-doc" ]; then
git clone https://github.com/nabijaczleweli/BearLibTerminal ~/BearLibTerminal;
pushd ~/BearLibTerminal/Build && cmake -G"Unix Makefiles" .. && make BearLibTerminal && popd;
mkdir -p ~/lib/ && cp ~/BearLibTerminal/Output/Linux64/libBearLibTerminal.so ~/lib/;
export LD_LIBRARY_PATH=~/lib/ LIBRARY_PATH=~/lib/;
fi
script:
- if [ "$LANGUAGE" == "Rust" ]; then make; fi
- if [ "$LANGUAGE" == "Rust" ]; then cargo build --verbose; fi
- if [ "$LANGUAGE" == "Rust" ]; then cargo test --verbose; fi
- if [ "$LANGUAGE" == "Rust" ] && [ "$CLIPPY_INSTALLED" == 1 ]; then cargo clippy; fi
- if [ "$LANGUAGE" == "Rust" ] && [ "$DEPLOY" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then cargo build --verbose --release; fi
-
- if [ "$LANGUAGE" == "Ruby" ]; then
ronn --organization="Lounge<C++>" man/*.md;
sed -i 's;<head>;&\n <meta charset="utf-8" />;' man/*.html;
fi
after_success:
- if [ "$LANGUAGE" == "Rust" ] && [ "$DEPLOY" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
mkdir -p "$TRAVIS_BUILD_DIR/../release";
cp target/release/pir-8-as target/release/pir-8-disasm target/release/pir-8-emu "$TRAVIS_BUILD_DIR/../release";
pushd "$TRAVIS_BUILD_DIR/../release";
strip --strip-all --remove-section=.comment --remove-section=.note pir-8-*;
tar -caf "pir-8-emu-$TRAVIS_TAG.tbz2" pir-8-as pir-8-disasm pir-8-emu;
mv "pir-8-emu-$TRAVIS_TAG.tbz2" "$DEPLOY_FILE";
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/../pir-8-emu-doc-$TRAVIS_TAG";
pushd "$TRAVIS_BUILD_DIR/..";
tar -caf "pir-8-emu-doc-$TRAVIS_TAG.tbz2" "pir-8-emu-doc-$TRAVIS_TAG";
rm -rf "pir-8-emu-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 git@github.com:$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 "nabijaczleweli@gmail.com";
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/../pir-8-emu-man-$TRAVIS_TAG";
pushd "$TRAVIS_BUILD_DIR/..";
tar -caf "pir-8-emu-man-$TRAVIS_TAG.tbz2" "pir-8-emu-man-$TRAVIS_TAG";
rm -rf "pir-8-emu-man-$TRAVIS_TAG";
popd;
fi
deploy:
provider: releases
api_key:
secure: "rHJmpzO+e72HCGpRJPMMaJJ+5bqEgJVrOfZp/O72jDpj/ALqUvRGC1H7oBCyI+2LwW8wS4i/h0XLBv1rh7/pxzXz2zCsr82AfeeWPLu06K8LsM/BEZyYZtMIenG9kRIGImzlTr9O/3/upr/6UsEQesMyFPm9q2313uFpnfWAzSgdG06z1CmfIFLCgrNYbFdbSYeqE7NdMErBM9doC+aez8fVA4IcXrA1XFqnOvKMUchjpeoqimPDKEHkfVP9n+3lwZvNjtqrVmfA3c1gTcwupAIVCrAvrS+j0Lvqj4EgmmMn1MK6KO+WPmibyii75r7n/ziwSWwES/vG7biPbMKZguKnE3r1z2kdvc9EzhyJPd3BbElb8xk5VRE8IokhD3wbaxwgHe9zCe0ezdBWx2nHvS6eP8ujyePpJQIqIYtzXFPfNT6bUMKKNPIwwh0l04dJIPtd9ckpKAAEg4b/+g7eO3FF55XolG5pnKLn4kneh0rCIAip5PSOcolYVj0ChqLQDdyZ71AO7EG+txuoPcVkAHid/yCznG5+PQtrmlE4/n1GPKo5om+6toWmZ2QR5PWGM3WNWFI/BVfXWIcZQG9PiSEHJSv3OWchqhmt2s+MVBfGLjMP8wRVDKMqGz6TzcR50dkO51OlXs4HsGfdEn+F1zGusVYZ5BfIc4OnAJHbhc4="
file: "$DEPLOY_FILE"
skip_cleanup: true
on:
tags: true
condition: "$DEPLOY == true"