mirror of
https://github.com/supabase/setup-cli.git
synced 2026-08-12 08:45:15 +00:00
Install Supabase CLI from npm (#442)
## Summary - install the Supabase CLI through the `supabase` npm package instead of GitHub release archives - support npm-backed `latest`, `beta`, and fixed published versions, with root lockfile detection preserved - remove the `github-token` input and use Node.js/npm without clobbering an already configured Node.js 20+ runtime - update CI/docs for the v3 action contract and remove stale license cache entries for removed dependencies Addresses CLI-1480: https://linear.app/supabase/issue/CLI-1480/source-cli-install-from-npm-registry No earlier pull request found to supersede. ## Validation - `bun run ci` - real npm install spot checks for `supabase@latest`, `supabase@beta`, `supabase@1.178.2`, `supabase@2.33.0`, and legacy `supabase@1.15.1` preinstall handling - external fixture run: https://github.com/jgoux/setup-cli-testing/actions/runs/28656824691 - hosted runners: Ubuntu, macOS, and Windows for `latest`, `beta`, `1.178.2`, and `2.33.0` - package-lock detection: resolved and installed `supabase@2.108.0` - legacy preinstall: installed `supabase@1.15.1` - Node preservation: kept a caller-provided Node.js 22 runtime active after the action - Alpine 3.20 container: `latest`, `beta`, and `2.100.0`, including Node.js 20+ and runtime dependency checks - Alpine 3.18 container: rejected Node.js 18 with a clear setup error
This commit is contained in:
@@ -7,7 +7,12 @@ The action supports `ubuntu-latest`, `windows-latest`, and `macos-latest`, and
|
||||
adds the requested `supabase` version to `PATH` for the rest of the job.
|
||||
|
||||
If `version` is omitted, the action checks the repository root for `bun.lock`,
|
||||
`pnpm-lock.yaml`, or `package-lock.json` and otherwise falls back to `latest`.
|
||||
`pnpm-lock.yaml`, or `package-lock.json` and otherwise falls back to npm
|
||||
`latest`.
|
||||
|
||||
The action uses an existing Node.js/npm runtime when one is already available,
|
||||
and requires Node.js 20 or newer. On non-musl runners without Node.js or npm, it
|
||||
provisions them internally. Runners only need network access to the npm registry.
|
||||
|
||||
## Quick Start
|
||||
|
||||
@@ -24,19 +29,27 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: supabase/setup-cli@v2
|
||||
- uses: supabase/setup-cli@v3
|
||||
- run: supabase init
|
||||
- run: supabase db start
|
||||
```
|
||||
|
||||
To pin a specific CLI version:
|
||||
To pin a fixed npm-published CLI version:
|
||||
|
||||
```yaml
|
||||
- uses: supabase/setup-cli@v2
|
||||
- uses: supabase/setup-cli@v3
|
||||
with:
|
||||
version: 2.84.2
|
||||
```
|
||||
|
||||
To test the current beta release:
|
||||
|
||||
```yaml
|
||||
- uses: supabase/setup-cli@v3
|
||||
with:
|
||||
version: beta
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
- **Source Code**: <https://github.com/supabase/setup-cli>
|
||||
|
||||
Reference in New Issue
Block a user