name: InstallEKSCTL
description: 'Installs eksctl'
inputs:
  version:
    description: "Version of EKSCTL to use for the launched cluster"
    required: true
runs:
  using: "composite"
  steps:
    - shell: bash
      env:
        VERSION: ${{ inputs.version }}
      run: |
        # for ARM systems, set ARCH to: `arm64`, `armv6` or `armv7`
        ARCH=amd64
        PLATFORM=$(uname -s)_$ARCH
        curl -sLO "https://github.com/weaveworks/eksctl/releases/download/$VERSION/eksctl_$PLATFORM.tar.gz"

        # (Optional) Verify checksum
        curl -sL "https://github.com/weaveworks/eksctl/releases/download/$VERSION/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check
        tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz
        sudo mv /tmp/eksctl /usr/local/bin
