actions-rust-cross/install-cross-nix.sh
2024-05-18 12:28:18 +08:00

28 lines
569 B
Bash
Executable File

#!/bin/bash
set -e
set -x
set -o pipefail
CROSS_DIR="$1"
VERSION="$2"
cd "$CROSS_DIR"
if [[ -n "$VERSION" ]] && ! [[ "$VERSION" =~ ^v ]]; then
cargo install cross --git https://github.com/cross-rs/cross --rev "$VERSION"
mv "$HOME/.cargo/bin/cross" .
exit 0
fi
VERSION_ARGS=""
if [ -n "$VERSION" ]; then
VERSION_ARGS="--tag $VERSION"
fi
export TARGET=.
curl --silent --location \
https://raw.githubusercontent.com/houseabsolute/ubi/master/bootstrap/bootstrap-ubi.sh |
sh
./ubi --project cross-rs/cross --matching musl --in . $VERSION_ARGS