You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
886B

  1. set -ex
  2. main() {
  3. curl https://sh.rustup.rs -sSf | \
  4. sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION
  5. local target=
  6. if [ $TRAVIS_OS_NAME = linux ]; then
  7. target=x86_64-unknown-linux-gnu
  8. sort=sort
  9. else
  10. target=x86_64-apple-darwin
  11. sort=gsort # for `sort --sort-version`, from brew's coreutils.
  12. fi
  13. # This fetches latest stable release
  14. local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
  15. | cut -d/ -f3 \
  16. | grep -E '^v[0-9.]+$' \
  17. | $sort --version-sort \
  18. | tail -n1)
  19. echo cross version: $tag
  20. curl -LSfs https://japaric.github.io/trust/install.sh | \
  21. sh -s -- \
  22. --force \
  23. --git japaric/cross \
  24. --tag $tag \
  25. --target $target
  26. }
  27. main