generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.sh
executable file
·24 lines (17 loc) · 810 Bytes
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
set -e
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none --profile minimal
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
args=()
# shellcheck disable=SC2206
[[ -n "${INPUT_COMPONENTS}" ]] && args+=(-c "${INPUT_COMPONENTS// /}")
# shellcheck disable=SC2206
[[ -n "${INPUT_TARGETS}" ]] && args+=(-t "${INPUT_TARGETS// /}")
rustup set auto-self-update disable
rustup toolchain install "${INPUT_RUST_VERSION}" --profile "${INPUT_PROFILE}" "${args[@]}"
rustup default "${INPUT_RUST_VERSION}"
# shellcheck disable=SC2129
echo "rustup_version=$(rustup --version)" >> $GITHUB_OUTPUT
echo "cargo_version=$(cargo --version)" >> $GITHUB_OUTPUT
echo "rustc_version=$(rustc --version)" >> $GITHUB_OUTPUT
echo "::add-matcher::${GITHUB_ACTION_PATH%/}/matcher.json"