mirror of
https://github.com/supabase/setup-cli.git
synced 2026-06-27 17:36:57 +00:00
fix: setup-cli on Linux musl containers (#431)
## Summary Fixes setup-cli in Alpine/Linux musl containers after the Supabase CLI v2.99+ release layout introduced a Bun/TypeScript `supabase` shim alongside `supabase-go`. This keeps the v2 action on Bun, but makes the musl paths explicit: - Detect Linux musl before running `oven-sh/setup-bun` and pass the matching `bun-linux-*-musl.zip` via `bun-download-url`. - Use POSIX `sh` for composite shell steps so the action can run in minimal Alpine containers without `bash`. - Detect Linux musl in the CLI installer and download the existing `.apk` release asset for CLI v2.99+. - Add the extracted APK `usr/bin` directory to PATH. - Keep existing tar/zip behavior for glibc Linux, macOS, and Windows. ## Root Cause `oven-sh/setup-bun` does not currently include libc detection in its automatic release asset selection, so Alpine containers received a glibc Bun binary. Separately, setup-cli downloaded the generic Linux `.tar.gz` Supabase CLI asset, whose `supabase` shim is glibc-linked in v2.99+; the `.apk` asset contains the musl-linked shim. ## Testing - `bun run ci` - Manual GitHub workflow in https://github.com/jgoux/setup-cli-testing/actions/runs/2616196598653
This commit is contained in:
40
action.yml
40
action.yml
@@ -15,19 +15,55 @@ outputs:
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- id: bun-download
|
||||
name: Resolve Bun Download URL
|
||||
shell: sh
|
||||
working-directory: ${{ github.action_path }}
|
||||
run: |
|
||||
set -eu
|
||||
|
||||
if [ "${RUNNER_OS}" != "Linux" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# setup-bun does not detect Linux musl yet, so Alpine-like containers need the musl asset explicitly.
|
||||
is_musl=false
|
||||
if [ -f /etc/alpine-release ]; then
|
||||
is_musl=true
|
||||
elif command -v ldd >/dev/null 2>&1 && ldd --version 2>&1 | grep -qi musl; then
|
||||
is_musl=true
|
||||
fi
|
||||
|
||||
if [ "${is_musl}" != "true" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
version="$(cat .bun-version)"
|
||||
case "$(uname -m)" in
|
||||
x86_64) arch="x64" ;;
|
||||
aarch64|arm64) arch="aarch64" ;;
|
||||
*)
|
||||
echo "Unsupported Linux musl architecture: $(uname -m)" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "url=https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-linux-${arch}-musl.zip" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
||||
with:
|
||||
bun-version-file: ${{ github.action_path }}/.bun-version
|
||||
bun-download-url: ${{ steps.bun-download.outputs.url }}
|
||||
|
||||
- name: Install Action Dependencies
|
||||
shell: bash
|
||||
shell: sh
|
||||
working-directory: ${{ github.action_path }}
|
||||
run: bun install --frozen-lockfile --production
|
||||
|
||||
- id: setup-cli
|
||||
name: Setup Supabase CLI
|
||||
shell: bash
|
||||
shell: sh
|
||||
working-directory: ${{ github.action_path }}
|
||||
env:
|
||||
INPUT_VERSION: ${{ inputs.version }}
|
||||
|
||||
Reference in New Issue
Block a user