lade 0.17.2

Automatically load secrets from your preferred vault as environment variables, and clear them once your shell command is over.
name: "setup-lade"
description: "Install the lade CLI (download a pinned or latest release, verify its SHA256 checksum, and add it to PATH)."
author: "zifeo"

branding:
  icon: "lock"
  color: "blue"

inputs:
  version:
    description: 'lade version to install (without leading "v"), or "latest".'
    required: false
    default: "latest"
  out-dir:
    description: "Directory to install the lade binary into (added to PATH)."
    required: false
    default: "${{ github.workspace }}/.lade-bin"

runs:
  using: "composite"
  steps:
    - name: Cache lade binary
      id: cache
      uses: actions/cache@v4
      with:
        path: ${{ inputs.out-dir }}
        key: lade-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}

    - name: Install lade
      shell: bash
      env:
        LADE_VERSION: ${{ inputs.version }}
        OUT_DIR: ${{ inputs.out-dir }}
      run: |
        set -euo pipefail
        mkdir -p "$OUT_DIR"
        if [ "$LADE_VERSION" = "latest" ]; then
          VERSION_ENV=""
        else
          VERSION_ENV="${LADE_VERSION#v}"
        fi
        if [ ! -x "$OUT_DIR/lade" ]; then
          curl -fsSL https://raw.githubusercontent.com/zifeo/lade/main/installer.sh \
            | CI=1 OUT_DIR="$OUT_DIR" VERSION="$VERSION_ENV" bash
        fi
        echo "$OUT_DIR" >> "$GITHUB_PATH"
        "$OUT_DIR/lade" --version