ffsend/.travis.yml

158 lines
4.7 KiB
YAML
Raw Normal View History

2018-03-26 18:51:14 +00:00
# Configuration for Travis CI
language: rust
sudo: required
services:
- docker
2018-03-26 18:51:14 +00:00
stages:
- build
- test
- name: release
if: tag =~ ^v(\d+\.)*\d+$
jobs:
include:
################################
# Build stage #
################################
# Linux with Rust stable/beta/nightly
- stage: build
rust: stable
env: TARGET=x86_64-unknown-linux-gnu
cache: cargo
script: &build-script
- cargo build --verbose --all
- cargo build --no-default-features --verbose --all
- cargo build --features no-color --verbose --all
- stage: build
rust: beta
env: TARGET=x86_64-unknown-linux-gnu
cache: cargo
script: *build-script
- stage: build
rust: nightly
env: TARGET=x86_64-unknown-linux-gnu
cache: cargo
script: *build-script
# macOS with Rust stable
- stage: build
rust: stable
os: osx
env: TARGET=x86_64-apple-darwin
cache: cargo
script: *build-script
################################
# Test stage #
################################
- stage: test
env: TARGET=x86_64-unknown-linux-gnu
cache: cargo
script: cargo test --verbose --all
################################
# Release stage #
################################
# # Cargo crate release
# - stage: release
# env: TARGET=x86_64-unknown-linux-gnu
# cache: cargo
# script:
# - echo "Creating release crate on crates.io..."
# - echo $CARGO_TOKEN | cargo login
# - cargo publish --verbose
# GitHub binary release for Linux on x86/x86_64
- stage: release
rust: stable
env: TARGET=x86_64-unknown-linux-gnu TARGET_SIMPLE=linux-x64 DEB=y
cache: cargo
install: &install-github-release
- |
if [ ! $TARGET == "x86_64-unknown-linux-gnu" ] && [ ! $TARGET == "x86_64-apple-darwin" ]; then
cargo install cross
fi
- |
if [ -n "$DEB" ]; then
cargo install cargo-deb
fi
script: &script-github-release
- |
if [ $TARGET == "x86_64-unknown-linux-gnu" ] || [ $TARGET == "x86_64-apple-darwin" ]; then
echo "Creating release binary on GitHub for $TARGET..."
cargo build --release --verbose --all
cp target/release/ffsend ./ffsend
else
echo "Creating release binary on GitHub for $TARGET (cross compiled)..."
cross build --target $TARGET --release --verbose --all
cp target/$TARGET/release/ffsend ./ffsend
fi
2018-05-31 15:47:43 +00:00
- tar -czvf ./ffsend-$TRAVIS_TAG-$TARGET_SIMPLE.tar.gz ffsend
- |
if [ -n "$DEB" ]; then
cargo deb --verbose
fi
2018-05-31 15:47:43 +00:00
- mv ./ffsend ./ffsend-$TRAVIS_TAG-$TARGET_SIMPLE
deploy: &deploy-github-release
provider: releases
api_key: $GITHUB_OAUTH_TOKEN
skip_cleanup: true
2018-05-30 18:15:06 +00:00
overwrite: true
file_glob: true
2018-05-30 18:15:06 +00:00
file:
- target/debian/ffsend_*.deb
2018-05-31 15:47:43 +00:00
- ffsend-$TRAVIS_TAG-$TARGET_SIMPLE.tar.gz
- ffsend-$TRAVIS_TAG-$TARGET_SIMPLE
on:
tags: true
branch: master
- stage: release
rust: stable
env: TARGET=i686-unknown-linux-gnu TARGET_SIMPLE=linux-i386 DEB=y
cache: cargo
install: *install-github-release
script: *script-github-release
deploy: *deploy-github-release
# GitHub binary release for Linux on arch
- stage: release
rust: stable
2018-05-30 18:15:06 +00:00
env: TARGET=aarch64-unknown-linux-gnu TARGET_SIMPLE=linux-aarch64
cache: cargo
install: *install-github-release
script: *script-github-release
deploy: *deploy-github-release
- stage: release
rust: stable
2018-05-30 18:15:06 +00:00
env: TARGET=arm-unknown-linux-gnueabi TARGET_SIMPLE=linux-arm
cache: cargo
install: *install-github-release
script: *script-github-release
deploy: *deploy-github-release
- stage: release
rust: stable
2018-05-30 18:15:06 +00:00
env: TARGET=armv7-unknown-linux-gnueabihf TARGET_SIMPLE=linux-armv7
cache: cargo
install: *install-github-release
script: *script-github-release
deploy: *deploy-github-release
# GitHub binary release for macOX
- stage: release
rust: stable
os: osx
2018-05-30 18:15:06 +00:00
env: TARGET=x86_64-apple-darwin TARGET_SIMPLE=osx-x64
cache: cargo
install: *install-github-release
script: *script-github-release
deploy: *deploy-github-release
# TODO: add Windows architecture (using AppVeyor)
# TODO: add (Free)BSD architecture
# TODO: enfore the git tag/crate version equality for releases
# TODO: disable addons/rust installation for GitHub release job