Skip to content

Commit c81f2dd

Browse files
authored
Use better release-artifact names. (#8)
1 parent 5c8e4df commit c81f2dd

File tree

2 files changed

+51
-10
lines changed

2 files changed

+51
-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: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,57 @@ 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+
ASSETS_NAMING_THRESHOLD_VERSION=v2.0.0-alpha.164
36+
37+
# Use sort -V to compare versions.
38+
if [[ "$TOIT_VERSION" == "latest" ]] || \
39+
[[ "$(echo -e "$ASSETS_NAMING_THRESHOLD_VERSION\n$TOIT_VERSION" | sort -V | tail -n 1)" == "$TOIT_VERSION" ]]; then
40+
if [[ "$RUNNER_OS" = "Linux" ]]; then
41+
case "$(uname -m)" in
42+
x86_64) TOIT_FILE=toit-linux-x64.tar.gz ;;
43+
armv7l) TOIT_FILE=toit-linux-armv7.tar.gz ;;
44+
aarch64) TOIT_FILE=toit-linux-aarch64.tar.gz ;;
45+
*)
46+
echo "UNSUPPORTED ARCHITECTURE: $(uname -m)"
47+
exit 1
48+
;;
49+
esac
50+
elif [[ "$RUNNER_OS" = "macOS" ]]; then
51+
case "$(uname -m)" in
52+
x86_64) TOIT_FILE=toit-macos-x64.tar.gz ;;
53+
arm64) TOIT_FILE=toit-macos-aarch64.tar.gz ;;
54+
*)
55+
echo "UNSUPPORTED ARCHITECTURE: $(uname -m)"
56+
exit 1
57+
;;
58+
esac
59+
elif [[ "$RUNNER_OS" = "Windows" ]]; then
60+
TOIT_FILE=toit-windows-x64.tar.gz
61+
else
62+
echo "UNSUPPORTED RUNNER: $RUNNER_OS"
63+
exit 1
64+
fi
4165
else
42-
echo "UNSUPPORTED RUNNER: $RUNNER_OS"
43-
exit 1
66+
if [[ "$RUNNER_OS" = "Linux" ]]; then
67+
case "$(uname -m)" in
68+
x86_64) TOIT_FILE=toit-linux.tar.gz;;
69+
armv7l) TOIT_FILE=toit-rpi.tar.gz;;
70+
aarch64) TOIT_FILE=toit-aarch64.tar.gz;;
71+
*)
72+
echo "UNSUPPORTED ARCHITECTURE: $(uname -m)"
73+
exit 1
74+
;;
75+
esac
76+
elif [[ "$RUNNER_OS" = "macOS" ]]; then
77+
TOIT_FILE=toit-macos.tar.gz
78+
elif [[ "$RUNNER_OS" = "Windows" ]]; then
79+
TOIT_FILE=toit-windows.tar.gz
80+
else
81+
echo "UNSUPPORTED RUNNER: $RUNNER_OS"
82+
exit 1
83+
fi
4484
fi
85+
4586
echo "TOIT_FILE=$TOIT_FILE" >> $GITHUB_OUTPUT
4687
4788
if [[ $TOIT_VERSION = latest ]]; then

0 commit comments

Comments
 (0)