fix: install Alpine runtime dependencies (#434)

## Summary
- Install `libstdc++` and `libgcc` before verifying CLI versions from
apk archives
- Keep non-apk archive installs unchanged
- Rebuild the v1 bundled action artifact

## Testing
- `npm run package`
- `npm run format:check`
- `npm run lint`
- `npm run test`
- Verified `supabase_2.100.0_linux_arm64.apk` fails on plain Alpine
without `libstdc++`/`libgcc` and reports `2.100.0` after installing them
This commit is contained in:
Julien Goux
2026-05-21 09:31:24 +02:00
committed by GitHub
parent ad077b4817
commit ab058987d8
4 changed files with 60 additions and 2 deletions

24
dist/index.js generated vendored
View File

@@ -60534,6 +60534,29 @@ const getDownloadArchive = async (version, platform = os__default.platform(), ar
const getCliPath = (extractedPath, archiveFormat) => {
return archiveFormat === 'apk' ? `${extractedPath}/usr/bin` : extractedPath;
};
const installAlpineRuntimeDependencies = async (archiveFormat) => {
if (archiveFormat !== 'apk') {
return;
}
try {
await doExec('command -v apk');
}
catch {
throw new Error('Linux musl containers need libstdc++ and libgcc to run Supabase CLI. Install them before supabase/setup-cli.');
}
try {
await doExec('apk info -e libstdc++ libgcc');
return;
}
catch {
const { stdout } = await doExec('id -u');
if (stdout.trim() !== '0') {
throw new Error("Alpine/musl containers need libstdc++ and libgcc to run Supabase CLI. Add 'apk add --no-cache libstdc++ libgcc' before supabase/setup-cli, or run this job container as root.");
}
}
// The Supabase CLI shim in the apk dynamically links these Alpine runtime libraries.
await doExec('apk add --no-cache libstdc++ libgcc');
};
const determineInstalledVersion = async () => {
const { stdout } = await doExec('supabase --version');
const version = stdout.trim();
@@ -60562,6 +60585,7 @@ async function run() {
? await extractZip(pathToArchive)
: await extractTar(pathToArchive);
const pathToCLI = getCliPath(extractedPath, download.format);
await installAlpineRuntimeDependencies(download.format);
// Expose the tool by adding it to the PATH
addPath(pathToCLI);
// Expose installed tool version

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long