Skip to content

Commit bc416a5

Browse files
committed
Use better release-artifact names.
1 parent 5c8e4df commit bc416a5

File tree

2 files changed

+64
-10
lines changed

2 files changed

+64
-10
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
build:
1111
strategy:
1212
matrix:
13-
os: [ubuntu-latest, macos-latest, windows-latest]
14-
version: [v2.0.0-alpha.130, latest, ""]
13+
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
14+
version: [v2.0.0-alpha.130, v2.0.0-alpha.164, latest, ""]
1515

1616
runs-on: ${{ matrix.os }}
1717

action.yml

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)