diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e36136a..69d0d2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/action.yml b/action.yml index 1f57767..2851022 100644 --- a/action.yml +++ b/action.yml @@ -32,16 +32,70 @@ 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 + # Use sort -V to compare versions. + if [[ "$(echo -e "v2.0.0-alpha.163"\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.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 else - echo "UNSUPPORTED RUNNER: $RUNNER_OS" - exit 1 + 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 fi + echo "TOIT_FILE=$TOIT_FILE" >> $GITHUB_OUTPUT if [[ $TOIT_VERSION = latest ]]; then