language: rust cache: cargo matrix: include: # Stable channel. - os: linux rust: stable env: TARGET=x86_64-unknown-linux-gnu - os: linux rust: stable env: TARGET=x86_64-unknown-linux-musl - os: osx rust: stable env: TARGET=x86_64-apple-darwin addons: apt: packages: # needed to build deb packages - fakeroot env: global: # Default target on travis-ci. # Used as conditional check in the install stage - HOST=x86_64-unknown-linux-gnu # Used on the deployment script - PROJECT_NAME=dup install: # prevent target re-add error from rustup - if [[ $TRAVIS_OS_NAME = linux && $HOST != $TARGET ]]; then rustup target add $TARGET; fi script: # Incorporate TARGET env var to the build and test process - cargo build --target $TARGET --verbose #- cargo test --target $TARGET --verbose before_deploy: - bash ci/before_deploy.bash deploy: provider: releases # NOTE updating the `api_key.secure` # - go to: https://github.com/settings/tokens/new # - generate new token using `public_repo` scope # - encrypt it using: `travis encrypt API_KEY_HERE` # - paste the output below api_key: secure: "KMtnIewsAFgyH8CaDjOAjubdXBL+ilfpINjO+bkdnsycfX24IHZZQIW/QmKcd5b6vemFPPUUkQzmZSOn5WqFBjyrQyvXJQmFa523ncqmkJS7oVypSMRqHmvlmABnvTSowZwEPxgsr0r++Qtb45ugFWZJd9lnAATm0jeKb7xaLnj192MwnesE6gCYXyqDjxbtxc2itFZIVMBvFEg1nYoYuoYbZkIOPoU4aRifWHj5Y+dlBH1WKDqPXisF4BzJN4w2jBiAvvkVWAQgUewb0sZ5K/aC+KLRhvIQCF+QquGUQihetYnuaC6gu0N+VCGztC/In0Kh0OS/qfTs1fCbmC5ZOVm4AMwOJvx/u65uc1wBUluekJCCdXcznfjALRA+SwE4XrIg7RTinez7ys+b3FA0dl8LWtrENRyQZcjypr/EpJVI/WfdW9tpEslO02VVEe1deyrIa/ir5IbKxsB75UNAktO6w86EJkFqsp2nfN94wAbpMsB/N9skzC7phTWdKHnrq30fsVzNQBAF//4LX23bdyWDHLQzASEaegIuQovNsfxwUZwZp29IbC8YY/Xj8mZr0anfHljF/lLUydyitA9KcbsHdXYFGZxHzR/M9nwpbMe0bpi00brU2TZPxEd6RctK+NQM4SIbhwkE5R8+gG2hSkH28FqiPUTRmNNYWUfJQIc=" # for uploading multiple files file_glob: true # NOTE explanation on each env variable # - PROJECT_NAME: name of the project, set on the `env.global` above # - TRAVIS_TAG: tag name that the build is being deployed for, usually the version number # - TARGET: target triple of the build file: - $PROJECT_NAME-$TRAVIS_TAG-$TARGET.* - $PROJECT_NAME*.deb # don't delete artifacts from previous stage skip_cleanup: true on: # deploy only if we push a tag tags: true # deploy only on stable channel that has TARGET env variable sets condition: $TRAVIS_RUST_VERSION = stable && $TARGET != "" notifications: email: on_success: never