@@ -32,16 +32,70 @@ runs:
3232 run : |
3333 TOIT_VERSION=${{ inputs.toit-version }}
3434
35- if [[ "$RUNNER_OS" = "Linux" ]]; then
36- TOIT_FILE=toit-linux.tar.gz
37- elif [[ "$RUNNER_OS" = "macOS" ]]; then
38- TOIT_FILE=toit-macos.tar.gz
39- elif [[ "$RUNNER_OS" = "Windows" ]]; then
40- TOIT_FILE=toit-windows.tar.gz
35+ # Use sort -V to compare versions.
36+ if [[ "$(echo -e "v2.0.0-alpha.163"\n$TOIT_VERSION" | sort -V | tail -n 1)" != "$TOIT_VERSION" ]]; then
37+ if [[ "$RUNNER_OS" = "Linux" ]]; then
38+ case "$(uname -m)" in
39+ x86_64)
40+ TOIT_FILE=toit-linux.tar.gz
41+ ;;
42+ armv7l)
43+ TOIT_FILE=toit-rpi.tar.gz
44+ ;;
45+ aarch64)
46+ TOIT_FILE=toit-aarch64.tar.gz
47+ ;;
48+ *)
49+ echo "UNSUPPORTED ARCHITECTURE: $(uname -m)"
50+ exit 1
51+ ;;
52+ esac
53+ elif [[ "$RUNNER_OS" = "macOS" ]]; then
54+ TOIT_FILE=toit-macos.tar.gz
55+ elif [[ "$RUNNER_OS" = "Windows" ]]; then
56+ TOIT_FILE=toit-windows.tar.gz
57+ else
58+ echo "UNSUPPORTED RUNNER: $RUNNER_OS"
59+ exit 1
60+ fi
4161 else
42- echo "UNSUPPORTED RUNNER: $RUNNER_OS"
43- exit 1
62+ if [[ "$RUNNER_OS" = "Linux" ]]; then
63+ case "$(uname -m)" in
64+ x86_64)
65+ TOIT_FILE=toit-linux-x64.tar.gz
66+ ;;
67+ armv7l)
68+ TOIT_FILE=toit-linux-armv7.tar.gz
69+ ;;
70+ aarch64)
71+ TOIT_FILE=toit-linux-aarch64.tar.gz
72+ ;;
73+ *)
74+ echo "UNSUPPORTED ARCHITECTURE: $(uname -m)"
75+ exit 1
76+ ;;
77+ esac
78+ elif [[ "$RUNNER_OS" = "macOS" ]]; then
79+ case "$(uname -m)" in
80+ x86_64)
81+ TOIT_FILE=toit-macos-x64.tar.gz
82+ ;;
83+ arm64)
84+ TOIT_FILE=toit-macos-aarch64.tar.gz
85+ ;;
86+ *)
87+ echo "UNSUPPORTED ARCHITECTURE: $(uname -m)"
88+ exit 1
89+ ;;
90+ esac
91+ elif [[ "$RUNNER_OS" = "Windows" ]]; then
92+ TOIT_FILE=toit-windows-x64.tar.gz
93+ else
94+ echo "UNSUPPORTED RUNNER: $RUNNER_OS"
95+ exit 1
96+ fi
4497 fi
98+
4599 echo "TOIT_FILE=$TOIT_FILE" >> $GITHUB_OUTPUT
46100
47101 if [[ $TOIT_VERSION = latest ]]; then
0 commit comments