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.

28 lines
761B

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