Multi target Rust builds with auto deployment in Travis-CI

Successful Travis Build

This is just a small build script to automatically compile and create Rust binaries for your i86 32 and 64 bit machine and your Raspberry Pi(ARM) with Travis-CI. On the right side I added a little explanation of the following script.

TLDR: Replace YOURPACKETNAME with your actual packet name. Add your YOUR SECRUITY KEY for auto deployment and specify YOURREPONAME.

We are using rust nightly in this case. You can also add more targets like stable or beta. We also use the apt cache, cargo cache is not possible here since the different targets are in conflict with each other. Now we specify NAME, TARGET, LINKER and the PACKAGE and add the compiler dependencies via apt. for each environment.

Install: Installs the TARGET via rustup and also adds the correct target to the cargo config.

Our actual compile script just runs cargo test for x86_64. All other targets are just built with the release and verbose flag.

If the compilation process is successful we get an .tar.gz archive with our finished binary. And if it’s a tagged release it automatically pushes the archives to the GitHub release page with the corresponding tag.

 $ git tag -a v1.4.2 
$ git push origin v1.4.2

Here a little info on how you can create your O-Auth token and a sample .travis.yml with the travis client in your repository.

$ travis setup releases