Skip to content

Commit 2eca1b4

Browse files
jgouxlicensed-ci
andauthored
chore: prepare for v2.0.0 (#405)
## Summary This PR prepares `supabase/setup-cli` for `v2.0.0`. The main goal of this release is to simplify the action and modernize the repo/tooling around a Bun-based implementation, while tightening workflows, tests, and documentation. ## What Changed ### Action runtime - switched the action from a Node/compiled `dist` runtime to a Bun-based composite action - removed the checked-in `dist/` output entirely - simplified the action source down to a single runtime file in `src/main.ts` - kept the public action interface the same: - `with.version` - `outputs.version` ### Tooling - switched package management and local tooling from npm to Bun - removed Rollup and the build step - replaced Jest with Bun’s native test runner - replaced Prettier with `oxfmt` - replaced ESLint with `oxlint` - enabled type-aware/type-check linting with `oxlint-tsgolint` - simplified TypeScript config to a single `tsconfig.json` extending `@tsconfig/bun` ### Tests - moved tests next to the runtime source - rewrote tests to focus on meaningful user-facing action behavior - added coverage for: - default entrypoint execution - latest version installs - legacy version installs - modern pinned version installs - failure when the installed CLI cannot report a version - action code coverage is now `100%` ### Workflows - renamed workflow files for clarity: - `test.yml` -> `ci.yml` - `start.yml` -> `e2e.yml` - updated workflow/job naming so required checks are clean and stable: - `CI` - `E2E` - `CodeQL` - `Licensed` - added aggregate PR-facing checks so branch protection does not need matrix legs - made CI and E2E skip heavy jobs on draft PRs - made E2E run automatically on ready PRs and new commits - simplified CodeQL config by removing the separate config file - updated action pins to current releases using commit SHAs - refined Dependabot for Bun-era updates and non-major auto-merge ### Docs - refreshed `README.md` and `docs/index.md` for the new v2 behavior - updated examples to use `@v2` - added a practical example for exporting local Supabase env vars after `supabase start` - removed stale references to old local/dev flows ## Breaking / Notable Changes - the action now runs as a Bun-based composite action instead of a prebuilt JavaScript action - no checked-in `dist/` artifacts anymore - self-hosted runners now need the prerequisites expected by the composite action path: - `bash` - network access to install Bun/dependencies and download the Supabase CLI ## Validation Verified locally with: - `bun run format:check` - `bun run lint` - `bun test` - `bun run ci` Also updated workflows and branch-protection-friendly check names so PR validation is cleaner going forward. ## Follow-up After merge, branch protection should require only: - `CI` - `E2E` - `CodeQL` - `Licensed` --------- Co-authored-by: licensed-ci <licensed-ci@users.noreply.github.com>
1 parent 6064504 commit 2eca1b4

52 files changed

Lines changed: 1253 additions & 46731 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bun-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.3.10

.gitattributes

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @supabase/dev-workflows
1+
* @supabase/cli

.github/codeql/codeql-config.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,26 @@ updates:
44
directory: /
55
schedule:
66
interval: weekly
7-
cooldown:
8-
default-days: 7
7+
open-pull-requests-limit: 2
98
groups:
109
actions-minor:
1110
update-types:
1211
- minor
1312
- patch
1413

15-
- package-ecosystem: npm
14+
- package-ecosystem: bun
1615
directory: /
1716
schedule:
18-
interval: daily
17+
interval: weekly
18+
open-pull-requests-limit: 2
1919
groups:
20-
npm-development:
20+
bun-development:
2121
dependency-type: development
2222
update-types:
2323
- minor
2424
- patch
25-
npm-production:
25+
bun-production:
2626
dependency-type: production
2727
update-types:
28+
- minor
2829
- patch
29-
ignore:
30-
# nodejs types is pinned to runtime version
31-
- dependency-name: '@types/node'
32-
update-types:
33-
- version-update:semver-major

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
- ready_for_review
10+
- converted_to_draft
11+
push:
12+
branches:
13+
- main
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
permissions:
20+
contents: read
21+
22+
defaults:
23+
run:
24+
shell: bash
25+
26+
jobs:
27+
validate:
28+
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 15
31+
steps:
32+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
33+
with:
34+
persist-credentials: false
35+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
36+
with:
37+
bun-version-file: .bun-version
38+
- run: bun install --frozen-lockfile
39+
- run: bun run ci
40+
41+
test:
42+
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
43+
runs-on: ${{ matrix.os }}
44+
timeout-minutes: 20
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
os: [macos-latest, windows-latest, ubuntu-latest]
49+
version: [1.0.0, latest]
50+
steps:
51+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
52+
- uses: ./
53+
with:
54+
version: ${{ matrix.version }}
55+
- run: supabase -h
56+
57+
ci:
58+
if: ${{ always() && github.event_name == 'pull_request' }}
59+
name: CI
60+
runs-on: ubuntu-latest
61+
needs: [validate, test]
62+
timeout-minutes: 5
63+
steps:
64+
- run: |
65+
validate_result="${{ needs.validate.result }}"
66+
test_result="${{ needs.test.result }}"
67+
[[ "$validate_result" == "success" || "$validate_result" == "skipped" ]]
68+
[[ "$test_result" == "success" || "$test_result" == "skipped" ]]

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/dependabot.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@ name: Dependabot auto-merge
33

44
on: pull_request
55

6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
8+
cancel-in-progress: true
9+
610
permissions:
711
pull-requests: write
812
contents: write
913

1014
jobs:
1115
dependabot:
1216
runs-on: ubuntu-latest
13-
# Checking the actor will prevent your Action run failing on non-Dependabot
14-
# PRs but also ensures that it only does work for Dependabot PRs.
17+
timeout-minutes: 10
18+
# Only act on PRs opened by Dependabot from branches in this repository.
1519
if: github.actor == 'dependabot[bot]' && github.repository == github.event.pull_request.head.repo.full_name
1620
steps:
17-
# This first step will fail if there's no metadata and so the approval
18-
# will not occur.
21+
# Metadata drives the non-major gating used for approval and auto-merge.
1922
- id: meta
2023
uses: dependabot/fetch-metadata@ffa630c65fa7e0ecfa0625b5ceda64399aea1b36 # v3.0.0
2124
with:
22-
github-token: '${{ secrets.GITHUB_TOKEN }}'
25+
github-token: "${{ secrets.GITHUB_TOKEN }}"
2326

24-
# Here the PR gets approved.
2527
- name: Approve a PR
26-
if: ${{steps.meta.outputs.update-type != 'version-update:semver-major'}}
28+
if: ${{ steps.meta.outputs.update-type != 'version-update:semver-major' }}
2729
run: gh pr review --approve "$PR_URL"
2830
env:
2931
PR_URL: ${{ github.event.pull_request.html_url }}
3032
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3133

32-
# Finally, this sets the PR to allow auto-merging for patch and minor
33-
# updates if all checks pass
3434
- name: Enable auto-merge for Dependabot PRs
35-
if: ${{steps.meta.outputs.update-type != 'version-update:semver-major'}}
35+
if: ${{ steps.meta.outputs.update-type != 'version-update:semver-major' }}
3636
run: gh pr merge --auto --squash "$PR_URL"
3737
env:
3838
PR_URL: ${{ github.event.pull_request.html_url }}

.github/workflows/e2e.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: E2E
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- synchronize
7+
- reopened
8+
- ready_for_review
9+
- converted_to_draft
10+
push:
11+
branches:
12+
- main
13+
tags:
14+
- "v[0-9]+.[0-9]+.[0-9]+"
15+
schedule:
16+
# * is a special character in YAML so you have to quote this string
17+
- cron: "30 1,9 * * *"
18+
workflow_dispatch:
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
defaults:
25+
run:
26+
shell: bash
27+
28+
permissions:
29+
contents: read
30+
31+
jobs:
32+
e2e: # make sure the action works on a clean machine without building
33+
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 45
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
version:
40+
- 1.178.2
41+
- 2.33.0
42+
- latest
43+
pg_major:
44+
- 14
45+
- 15
46+
- 17
47+
exclude:
48+
- version: 1.178.2
49+
pg_major: 17
50+
steps:
51+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
52+
with:
53+
persist-credentials: false
54+
- uses: ./
55+
with:
56+
version: ${{ matrix.version }}
57+
- run: supabase init
58+
- run: |
59+
sed -i -E "s|^(major_version) .*|\\1 = ${{ matrix.pg_major }}|" supabase/config.toml
60+
- run: supabase start
61+
62+
e2e-check:
63+
if: ${{ always() && github.event_name == 'pull_request' }}
64+
name: E2E
65+
runs-on: ubuntu-latest
66+
needs: [e2e]
67+
timeout-minutes: 5
68+
steps:
69+
- run: |
70+
e2e_result="${{ needs.e2e.result }}"
71+
[[ "$e2e_result" == "success" || "$e2e_result" == "skipped" ]]

0 commit comments

Comments
 (0)