This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy path.travis.yml
96 lines (80 loc) · 2.99 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
os:
- linux
- osx
dist: trusty # For linux
addons:
apt:
packages:
- g++-mingw-w64 # For dlltool
language: ruby
rvm:
- 2.4.0
cache:
directories:
- $HOME/.rvm/gems
- $HOME/.cargo
- $HOME/.multirust
env:
global:
- EXAMPLES="unit calculator console duration docopt game_of_life geometry json_builder membership text_transform turbo_blank"
- VERBOSE=true
- RUST_BACKTRACE=1
- RUST_VERSION=stable
matrix:
include:
- os: linux
env: RUST_VERSION=nightly
allow_failures:
- env: RUST_VERSION=nightly
before_install:
# If we've got a tag, we also want to test the release
- if [ ! -z "$TRAVIS_TAG" ]; then export TEST_RELEASE=1; fi
# This only works on Linux
- if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then unset TEST_RELEASE; fi
# Only try to release on stable
# FIXME: There should be a better way of doing this
- if [[ "$RUST_VERSION" != "stable" ]]; then unset TEST_RELEASE; fi
# Install Rust
- if [ ! -e "$HOME/.cargo/bin" ]; then curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUST_VERSION -y; fi
- export PATH="$HOME/.cargo/bin:$PATH"
- rustup default $RUST_VERSION
- gem install bundler
install:
- ./scripts/ci-install
script: |
if [ -z "$TEST_RELEASE" ]; then
# Run regular tests if we're not testing the release
rake
else
set -e
./scripts/test-release
# Release if we're also tagged
if [ ! -z "$TRAVIS_TAG" ]; then
# Set up Cargo and Rubygems credentials
cargo login $CARGO_TOKEN
mkdir -p ~/.gem
echo -e "---\n:rubygems_api_key: $RUBYGEMS_TOKEN" > ~/.gem/credentials
chmod 0600 ~/.gem/credentials
echo -e "Publishing helix_runtime gem...\n"
pushd ruby
gem build helix_runtime.gemspec
gem push helix_runtime-*.gem
popd
echo -e "Publishing libcruby-sys crate...\n"
# need to do this since there's a .gitignore with *.lib files
# there's a bug in Cargo, where include isn't overriding exclude
rm -rf .git
pushd crates/libcruby-sys
HELIX_LIB_DIR=$PWD cargo publish
popd
echo -e "Publishing helix crate...\n"
cargo publish
fi
fi
notifications:
slack:
rooms:
- secure: "EeBBy+QWPtj20Dh0dw9MrIiul6kmVb7YrAqaf8VzpujD8BctasqoPx8VEefHZbBYnzDo8+/yerNorwczU7w5SmSXPvYgTCpUe3eKMgbLNBDBkLhp7L5WMO6YWdlsBpOT+i7lpImqecxTasMcTeMTMPoljtkaZdF+6+kh0dPntGMXsJlh8WWipFHH08anbTz4Ll8R9kta54r9yT2YDp0LSBKC+C2mW6ll6yvRwHZMbLi3c+DzR1mqCIljmeNTIqVm0+Er34Jj8lKOL8dYhyB8TncmxlDdbpzA9R8rJ8GczwvUJOkY3IREvY0eZh1T8JZ4yZZucIq1VgukgMo8rWjMBxq5jJjHpO/EmcyGPvvNnrkg5/Jy/2zDPpdqLvAieD5DReGUEkXcyPjNC2o0K6HAMQnloO2qVRwWIsuvwPu/EK9CFtSebZYSA1cDbQsvAyQ8c4S8nxYOy5YiZwJoD55N051p6ehTGe0gPDn254GwDMEmPEpH4xP/TmYEMzMFqjeSpOKPHNKRqrTmM7dff5yQnRdcm8o2t5GABf29uRkbao0fJa5kVQkVchbzo7U0mfguMGCSMJWM9yMp+mJ8dlz5WitsbGx0Bimu2ZnjOQ5YdQaJWQnCX1Rf+DwqGEipI3ii+l9xeg1VKfZi9Geckn9cF8yaw/y5A/EuvQOKmeOQ7qQ="
on_pull_requests: false
on_success: change
on_failure: always