mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-05 02:29:32 +00:00
6a8a5b7642
This should fix deploying release artifacts and gh-pages for the documentation. Secrets should now be configured in the UI for travis and appveyor. This also removes some of the appveyor jobs, since they aren't really necessary, and there are limited jobs on rust-lang-libs.
82 lines
2.1 KiB
YAML
82 lines
2.1 KiB
YAML
language: rust
|
|
|
|
cache:
|
|
directories:
|
|
- "$HOME/.cargo"
|
|
- "$HOME/.cache/sccache"
|
|
before_cache:
|
|
- rm -rf "$HOME/.cargo/registry"
|
|
|
|
env:
|
|
global:
|
|
- CRATE_NAME=mdbook
|
|
|
|
matrix:
|
|
include:
|
|
- rust: stable
|
|
env: TARGET=x86_64-unknown-linux-gnu
|
|
- rust: beta
|
|
env: TARGET=x86_64-unknown-linux-gnu
|
|
- rust: nightly
|
|
env: TARGET=x86_64-unknown-linux-gnu
|
|
|
|
- rust: stable
|
|
os: osx
|
|
env: TARGET=x86_64-apple-darwin
|
|
|
|
before_install:
|
|
- export SCCACHE_VER=0.2.8 RUSTC_WRAPPER=sccache
|
|
- case "$TRAVIS_OS_NAME" in
|
|
linux )
|
|
cd /tmp
|
|
&& travis_retry curl -sSL "https://github.com/mozilla/sccache/releases/download/${SCCACHE_VER}/sccache-${SCCACHE_VER}-x86_64-unknown-linux-musl.tar.gz" | tar xzf -
|
|
&& sudo mv "sccache-${SCCACHE_VER}-x86_64-unknown-linux-musl/sccache" /usr/local/bin/sccache;
|
|
;;
|
|
osx )
|
|
cd "${TMPDIR}"
|
|
&& travis_retry curl -sSL "https://github.com/mozilla/sccache/releases/download/${SCCACHE_VER}/sccache-${SCCACHE_VER}-x86_64-apple-darwin.tar.gz" | tar xzf -
|
|
&& sudo mv "sccache-${SCCACHE_VER}-x86_64-apple-darwin/sccache" /usr/local/bin/sccache;
|
|
;;
|
|
* ) unset RUSTC_WRAPPER;;
|
|
esac
|
|
- cd "$TRAVIS_BUILD_DIR"
|
|
|
|
script:
|
|
- cargo test --all
|
|
- cargo test --all --no-default-features
|
|
- if [ "$TARGET" = x86_64-unknown-linux-gnu ] && [ "$TRAVIS_RUST_VERSION" = stable ]; then
|
|
rustup component add rustfmt;
|
|
rustfmt -vV;
|
|
cargo fmt --all -- --check;
|
|
fi
|
|
|
|
before_deploy:
|
|
- cargo run -- build book-example
|
|
- sh ci/before_deploy.sh
|
|
|
|
deploy:
|
|
- provider: releases
|
|
api_key: "$GITHUB_TOKEN"
|
|
file_glob: true
|
|
file: "$CRATE_NAME-$TRAVIS_TAG-$TARGET.*"
|
|
on:
|
|
condition: "$TRAVIS_RUST_VERSION = stable"
|
|
tags: true
|
|
skip_cleanup: true
|
|
- provider: pages
|
|
local_dir: book-example/book
|
|
skip_cleanup: true
|
|
github_token: "$GITHUB_TOKEN"
|
|
keep_history: true
|
|
on:
|
|
condition: $TRAVIS_OS_NAME = "linux" && $TRAVIS_RUST_VERSION = "stable"
|
|
tags: true
|
|
|
|
branches:
|
|
only:
|
|
- master
|
|
- /^v\d+\.\d+\.\d+.*$/
|
|
|
|
notifications:
|
|
email:
|
|
on_success: never
|