language: rust
matrix:
  include:
  - env:
    - TARGET=x86_64-unknown-linux-gnu
    - ARCH=x86_64
  - env:
    - TARGET=x86_64-apple-darwin
    - ARCH=x86_64
    os: osx
rust:
  - nightly

before_cache:
  - chmod -R a+r $HOME/.cargo

cache: cargo

before_deploy:
- cargo build --release
- mkdir dist
- cd target/release
- tar -cvzf swerve-$TRAVIS_BRANCH.$TARGET.tar.gz swerve
- cp swerve-$TRAVIS_BRANCH.$TARGET.tar.gz ../../dist

deploy:
  - provider: releases
    api_key:
      secure: hoonHcAMie7yiZDkQdDzNYGU5zI2U8xCF70lZyvDMwwvicCn9vHCAxVDDGza6amFranfwQ8vKin3I6PYpNazt1VDrv+98dvkawFeJy30b0DNqo2uKaLN2IWA9IYjBTAVd2cSqA8vRhf89gfwA1x0/8pbosZXI7lF76kbU7QxiNfRVnc8uTOL2WBF7MjtqOKrQ+yQ7RQ/Bf+N31h6YR+HLknKZ+DZrZONKHVd62ThGcDajPYYOzODZlgrNct3asrO6QW5cYbIuguljXhPaWHpJ9130GDOOS3E7PQBBkxPJEI8+urZQ7aRQD7iu/DbDX3hkWPEh0BBUtJ8zlzv6T1dhwMkaqDsjGIv3Z/EdVt71DH+wocqF3wsiKfwGnmINu0atRlWCRT5nOhUb2UfWVoLYcHJOlU+nHkU4VRoPOlJaPwd3Ll98TBjObFl2khipKrKVcNc6zaaQQSVLrXZsaSHIDF8nTNgco4JP7V85FnS65hjXIzeiUP3SqAFMwmeGkRitCChIbYPgBfM46f+I3D4kJDy3Q1Yld3tLvDb+G4GuqsUYr9MFmXxInTN+ScruSW/eqeO3Cf2U0bcNBzSqGmCpSYFNwDNax+WhPnlNwNZwM6T0Co5i9BYUTdfnzzrFpuuCU36G20yD+lkAAvovfK5+yHWR1T4Qj72ij9/GacFKhw=
    skip_cleanup: true
    file: target/release/swerve-$TRAVIS_BRANCH.$TARGET.tar.gz
    on:
      repo: Commander-lol/rust-swerve
      tags: true
  - provider: gcs
    access_key_id: GOOGNGZV5EXRV6E2YPFNN62I
    secret_access_key:
      secure: lKeiFyxS5WOJM5a31haqaUVh+nYN1N1DvlGsVDBkXyEpBut7a/qV7HM3HM2UQSKhLRgusTpA+/eCg6sT5BA5J0NtHYIACZLNa1KX3SZqRmCDs8VbMYo4R7Q50sORst8Qr+9D+9FtuM6Mk8pGoi3MdIfUnuY4zA0Vxl+F0IvAaD6gACwRfexjQYllTXtCobnH5VNQ+1yZoU9fXmrrcyU1D9NN9Vlip08dYqq//FNEVyjv3vOkcarDOKdk/js3M6Q/YAbU3eY16RTEyto4TzErcp7NQiwapVwsJtAW3wjyTeTbYPM3YeE3alkATuDe9rF/cp+uJkkMwplc86RVgYPpqpA8jMe0mY2OjiuJKP01nPO+jTYqsup4J+GNJnaZHbswxALHtpEsvBPFClo1v8yfukap9nz3PePKna9JHMCRdZQ8OukukGYwdro84A5H/w9oPeKQIgAWO0x8HlknBkLL/DOjx1eIHvMKb5fDj6qUOYts50a5jVQ38iqKNFvf8EbildzSKetDvt9MZ14PFdTOZmA2lupdn2DDl5Ggf3sAQAozDNhPR70QMCZ7bcWTfiFbj62IcHERVKkiUHzKc3eaPLD4DKn3xDrVAamrle7pI/4vS7dwdOEC2D5mBo3SDB99jceFCXokYggh3OcxLXdrHYLkEcdAg1qwBe8+6DBbRn0=
    bucket: swerve-artefacts
    local-dir: dist
    skip_cleanup: true
    on:
      repo: Commander-lol/rust-swerve
      branch: master