Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use better release-artifact names. #8

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [v2.0.0-alpha.130, latest, ""]
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
version: [v2.0.0-alpha.130, v2.0.0-alpha.164, latest, ""]

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

Expand Down
57 changes: 49 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,57 @@ runs:
run: |
TOIT_VERSION=${{ inputs.toit-version }}

if [[ "$RUNNER_OS" = "Linux" ]]; then
TOIT_FILE=toit-linux.tar.gz
elif [[ "$RUNNER_OS" = "macOS" ]]; then
TOIT_FILE=toit-macos.tar.gz
elif [[ "$RUNNER_OS" = "Windows" ]]; then
TOIT_FILE=toit-windows.tar.gz
ASSETS_NAMING_THRESHOLD_VERSION=v2.0.0-alpha.164

# Use sort -V to compare versions.
if [[ "$TOIT_VERSION" == "latest" ]] || \
[[ "$(echo -e "$ASSETS_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 ;;
*)
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 ;;
*)
echo "UNSUPPORTED ARCHITECTURE: $(uname -m)"
exit 1
;;
esac
elif [[ "$RUNNER_OS" = "Windows" ]]; then
TOIT_FILE=toit-windows-x64.tar.gz
else
echo "UNSUPPORTED RUNNER: $RUNNER_OS"
exit 1
fi
else
echo "UNSUPPORTED RUNNER: $RUNNER_OS"
exit 1
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;;
*)
echo "UNSUPPORTED ARCHITECTURE: $(uname -m)"
exit 1
;;
esac
elif [[ "$RUNNER_OS" = "macOS" ]]; then
TOIT_FILE=toit-macos.tar.gz
elif [[ "$RUNNER_OS" = "Windows" ]]; then
TOIT_FILE=toit-windows.tar.gz
else
echo "UNSUPPORTED RUNNER: $RUNNER_OS"
exit 1
fi
fi

echo "TOIT_FILE=$TOIT_FILE" >> $GITHUB_OUTPUT

if [[ $TOIT_VERSION = latest ]]; then
Expand Down