-
Notifications
You must be signed in to change notification settings - Fork 553
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This also adds infrastructure to make it easier to add more check targets in the future.
- Loading branch information
1 parent
f91e7e1
commit fbc1b93
Showing
2 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
main() { | ||
local target= | ||
if [[ "$(os)" == "ubuntu-latest" || "$(os)" == Linux ]]; then | ||
target=x86_64-unknown-linux-musl | ||
# shellcheck disable=SC2209 | ||
sort=sort | ||
else | ||
target=x86_64-apple-darwin | ||
sort=gsort | ||
fi | ||
|
||
# This fetches latest stable release | ||
local tag | ||
tag=$(git ls-remote --tags --refs --exit-code https://github.com/rust-embedded/cross \ | ||
| cut -d/ -f3 \ | ||
| grep -E '^v[0.1.0-9.]+$' \ | ||
| $sort --version-sort \ | ||
| tail -n1) | ||
|
||
curl -LSfs https://japaric.github.io/trust/install.sh | \ | ||
sh -s -- \ | ||
--force \ | ||
--git rust-embedded/cross \ | ||
--tag "$tag" \ | ||
--target $target | ||
|
||
cross --version | ||
} | ||
|
||
# get an os name, either github's pre-set one or the result of uname | ||
os() { | ||
if [ -n "${OS_NAME:-}" ]; then | ||
echo "$OS_NAME" | ||
return | ||
fi | ||
uname | ||
} | ||
|
||
main |