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
- cd target/release
- tar -cvzf swerve.$TARGET.tar.gz swerve

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.$TARGET.tar.gz
    on:
      repo: Commander-lol/rust-swerve
      tags: true
  - provider: s3
    secret_access_key:
      secure: McmrccPXOMutbRVqToC2fjRMNk2cACnuOae80uvOoUN/saj2BE88kSC4+MQbKk0+JlqyGcCc4hNbVyl3vPyAHwSnYNK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/xal2USzPZH7fEL3MSq192dxko7yq8Yzg/EIqBDFQJTSIG+BNBewV+cYMzHnkzjHqJjBP7y8iYnNYl/0IpTKiDEg9OyJ+Kzvr1xjy5i8TiWGw+8nE9et6wBIeisYlws2NmsOlIKjqtY4nW5GYRqvgZvqVWkeN2Pp00xespJgwi9VCl0jpbMv1CXneIpoe0yhzM1+mvsZ59g=
    skip_cleanup: true
    bucket: swerve-server
    acl: public_read
    file: target/release/swerve.$TARGET.tar.gz
    on:
      repo: Commander-lol/rust-swerve
      tags: true
