This repository has been archived by the owner on Nov 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
85 lines (79 loc) · 2.23 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
branches:
only:
- development
- /^build-.*$/
env:
gobal:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
matrix:
include:
- os: linux
language: rust
rust: nightly
node_js: '9'
env:
- OS_TARGET="linux"
- os: osx
osx_image: xcode9.2
language: rust
node_js: '9'
rust: nightly
env:
- OS_TARGET="mac"
cache:
cargo: true
yarn: true
directories:
- gameserver/target
- client/node_modules
- planetwars/client/node_modules
- planetwars/visualizer/node_modules
- planetwars/match-log/node_modules
- $HOME/.cargo/
- $HOME/.cache/electron
- $HOME/.cache/electron-builder
before_cache:
# Travis can't cache files that are not readable by "others"
- chmod -R a+r $HOME/.cargo
before_install:
# Repo for Yarn
- |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew install yarn --without-node
mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v2.3.1/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-2.3.1.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1
export PATH="/tmp/git-lfs:$PATH"
else
sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update -qq
sudo apt-get install -y -qq yarn
fi
before_script:
- git lfs pull
script:
# Build Rust gameserver crate
- cd gameserver
- cargo build --release
- cd $TRAVIS_BUILD_DIR
# Copy binary to electron client
- cp gameserver/target/release/mozaic_bot_driver planetwars/client/bin/mozaic_bot_driver
# Build js mozaic-client package (network interface)
- cd client
- yarn install
- yarn run build
- cd $TRAVIS_BUILD_DIR
# Build js planetwars-match-log package
- cd planetwars/match-log
- yarn install
- yarn build
- cd $TRAVIS_BUILD_DIR
# Build js planetwars-visualizer package
- cd planetwars/visualizer
- yarn install
- yarn build
- cd $TRAVIS_BUILD_DIR
# Build js electron client package and package binary
- cd planetwars/client
- yarn install
- yarn run package-$OS_TARGET