Skip to content

Commit

Permalink
Minor syntactic changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch committed Nov 7, 2024
1 parent 369b053 commit 8d777bd
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,25 @@ runs:
run: |
TOIT_VERSION=${{ inputs.toit-version }}
BETTER_NAME_VERSION=v2.0.0-alpha.163
ARTIFACT_NAMING_THRESHOLD_VERSION=v2.0.0-alpha.163
# Use sort -V to compare versions.
if [[ "$TOIT_VERSION" == "latest" ]] || [[ "$(echo -e "$BETTER_NAME_VERSION\n$TOIT_VERSION" | sort -V | tail -n 1)" == "$TOIT_VERSION" ]]; then
if [[ "$TOIT_VERSION" == "latest" ]] || \
[[ "$(echo -e "$ARTIFACT_NAMING_THRESHOLD_VERSION\n$TOIT_VERSION" | sort -V | tail -n 1)" == "$TOIT_VERSION" ]]; then
if [[ "$RUNNER_OS" = "Linux" ]]; then
case "$(uname -m)" in
x86_64)
TOIT_FILE=toit-linux-x64.tar.gz
;;
armv7l)
TOIT_FILE=toit-linux-armv7.tar.gz
;;
aarch64)
TOIT_FILE=toit-linux-aarch64.tar.gz
;;
x86_64) TOIT_FILE=toit-linux-x64.tar.gz ;;
armv7l) TOIT_FILE=toit-linux-armv7.tar.gz ;;
aarch64) TOIT_FILE=toit-linux-aarch64.tar.gz ;;
*)
echo "UNSUPPORTED ARCHITECTURE: $(uname -m)"
exit 1
;;
esac
elif [[ "$RUNNER_OS" = "macOS" ]]; then
case "$(uname -m)" in
x86_64)
TOIT_FILE=toit-macos-x64.tar.gz
;;
arm64)
TOIT_FILE=toit-macos-aarch64.tar.gz
;;
x86_64) TOIT_FILE=toit-macos-x64.tar.gz ;;
arm64) TOIT_FILE=toit-macos-aarch64.tar.gz ;;
*)
echo "UNSUPPORTED ARCHITECTURE: $(uname -m)"
exit 1
Expand All @@ -74,15 +65,9 @@ runs:
else
if [[ "$RUNNER_OS" = "Linux" ]]; then
case "$(uname -m)" in
x86_64)
TOIT_FILE=toit-linux.tar.gz
;;
armv7l)
TOIT_FILE=toit-rpi.tar.gz
;;
aarch64)
TOIT_FILE=toit-aarch64.tar.gz
;;
x86_64) TOIT_FILE=toit-linux.tar.gz;;
armv7l) TOIT_FILE=toit-rpi.tar.gz;;
aarch64) TOIT_FILE=toit-aarch64.tar.gz;;
*)
echo "UNSUPPORTED ARCHITECTURE: $(uname -m)"
exit 1
Expand Down

0 comments on commit 8d777bd

Please sign in to comment.