language: rust
rust:
- nightly
- stable
matrix:
allow_failures:
- rust: stable
fast_finish: true
cache: cargo
branches:
only:
- staging
notifications:
recipients:
- dante.signal31@gmail.com
on_sucess: always
on_failure: always
before_script:
- cargo update
script:
- echo "Starting tests..."
- cargo test --verbose
- echo "Tests done."
jobs:
include:
- stage: Branch merge to production branch
python: 3.6
env:
- PYTHONPATH="${PYTHONPATH}:${TRAVIS_BUILD_DIR}"
if: branch = staging
script:
- echo "Merging staging branch with master..."
- ci_scripts/merge_with_production
- echo "Merge done."
- stage: Crates.io deployment
script:
- echo "Deploying to crates.io..."
- cargo login $CARGO_TOKEN
- cargo publish --allow-dirty
- echo "Crates.io deployment done."
- stage: Python module building
language: rust
sudo: required
script:
- echo "Deploying python module to Pypi..."
- sudo apt-get update
- sudo apt-get install python3-venv
- python3 -m venv env3
- source env3/bin/activate
- pip --version
- pip install cffi
- pip install pyo3-pack
- pyo3-pack publish -b cffi -u $PYPI_USERNAME -p $PYPI_PASSWORD
- echo "Python module deployed."
- stage: Debian packaging and deployment.
language: rust
if: branch = staging
script:
- echo "Building manpage..."
- sudo apt-get update
- sudo apt-get install pandoc
- mkdir man
- pandoc --standalone --to man README.md -o man/steganer.1
- gzip man/steganer.1
- echo "Manpage built."
- echo "Creating and deploying debian package"
- cargo deb
- ci_scripts/create_bintray_descriptors_from_templates
- ci_scripts/tag_release
deploy:
- provider: releases
api_key: "${GITHUB_TOKEN}"
file_glob: true
file: target/debian/*.deb
skip_cleanup: true
on:
all_branches: true
- provider: bintray
file: "packaging/steganer_debian_bintray_descriptor.json"
user: "${BINTRAY_USERNAME}"
key: "${BINTRAY_KEY}"
skip_cleanup: true
on:
all_branches: true