Skip to content

Commit 404a419

Browse files
committed
chore(monorepo): merge dx-lab/main into consolidated tree
2 parents 7938685 + 5d1f730 commit 404a419

1,736 files changed

Lines changed: 166174 additions & 0 deletions

File tree

Some content is hidden

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

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @supabase/cli

.github/actions/setup/action.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Setup
2+
3+
description: Perform standard setup and install dependencies using pnpm
4+
5+
runs:
6+
using: "composite"
7+
steps:
8+
- name: Install Bun
9+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
10+
with:
11+
bun-version: latest
12+
13+
- name: Install Node.js
14+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
15+
with:
16+
node-version-file: .nvmrc
17+
package-manager-cache: false
18+
19+
- name: Enable Corepack
20+
shell: bash
21+
run: npm install --global corepack && corepack enable
22+
23+
- name: Configure dependency cache
24+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
25+
with:
26+
cache: pnpm
27+
28+
- name: Install dependencies
29+
shell: bash
30+
run: pnpm install --frozen-lockfile
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Alpha
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Alpha npm package version to publish
8+
required: true
9+
type: string
10+
dry_run:
11+
description: Dry run (skip actual publishing)
12+
required: false
13+
type: boolean
14+
default: true
15+
16+
jobs:
17+
release:
18+
uses: ./.github/workflows/release-shared.yml
19+
with:
20+
version: ${{ inputs.version }}
21+
shell: next
22+
npm_tag: alpha
23+
prerelease: true
24+
dry_run: ${{ inputs.dry_run }}
25+
secrets: inherit
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
name: Release Shared
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
description: npm package version to publish
8+
required: true
9+
type: string
10+
shell:
11+
description: CLI shell to package as the shipped supabase binary
12+
required: true
13+
type: string
14+
npm_tag:
15+
description: npm dist-tag to publish under
16+
required: true
17+
type: string
18+
prerelease:
19+
description: Whether the GitHub release should be marked as a prerelease
20+
required: true
21+
type: boolean
22+
dry_run:
23+
description: Dry run (skip actual publishing)
24+
required: true
25+
type: boolean
26+
27+
jobs:
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
33+
34+
- name: Setup
35+
uses: ./.github/actions/setup
36+
37+
- name: Install nfpm
38+
run: |
39+
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
40+
sudo apt-get update
41+
sudo apt-get install -y nfpm
42+
43+
- name: Sync versions
44+
run: pnpm exec bun apps/cli/scripts/sync-versions.ts --version ${{ inputs.version }}
45+
46+
- name: Build selected shell
47+
run: pnpm exec bun apps/cli/scripts/build.ts --version ${{ inputs.version }} --shell ${{ inputs.shell }}
48+
49+
- name: Verify build artifacts
50+
run: |
51+
for pkg in cli-darwin-arm64 cli-darwin-x64 cli-linux-arm64 cli-linux-arm64-musl cli-linux-x64 cli-linux-x64-musl cli-windows-arm64 cli-windows-x64; do
52+
echo "Checking packages/$pkg/bin/..."
53+
ls -la "packages/$pkg/bin/"
54+
done
55+
echo "Checking dist/..."
56+
ls -la dist/
57+
58+
- name: Upload build artifacts
59+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
60+
with:
61+
name: cli-build-${{ inputs.shell }}-${{ inputs.version }}
62+
path: |
63+
packages/cli-*/bin/
64+
dist/
65+
66+
smoke-test:
67+
needs: build
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
runner: [ubuntu-latest, macos-latest, macos-15-intel, windows-latest]
72+
runs-on: ${{ matrix.runner }}
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
76+
77+
- name: Setup
78+
uses: ./.github/actions/setup
79+
80+
- name: Download build artifacts
81+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
82+
with:
83+
name: cli-build-${{ inputs.shell }}-${{ inputs.version }}
84+
85+
- name: Setup QEMU for cross-platform Docker
86+
if: runner.os == 'Linux'
87+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
88+
89+
- name: Install Scoop
90+
if: runner.os == 'Windows'
91+
shell: pwsh
92+
run: |
93+
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
94+
Join-Path (Resolve-Path ~).Path "scoop\shims" >> $env:GITHUB_PATH
95+
96+
- name: Fix binary permissions
97+
if: runner.os != 'Windows'
98+
run: chmod +x packages/cli-*/bin/supabase || true
99+
100+
- name: Run smoke tests
101+
run: pnpm run test:smoke -- --version ${{ inputs.version }} --tag ${{ inputs.npm_tag }}
102+
working-directory: apps/cli
103+
104+
publish:
105+
needs: smoke-test
106+
if: ${{ !inputs.dry_run }}
107+
runs-on: ubuntu-latest
108+
permissions:
109+
contents: write
110+
id-token: write
111+
steps:
112+
- name: Checkout
113+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
114+
115+
- name: Setup
116+
uses: ./.github/actions/setup
117+
118+
- name: Download build artifacts
119+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
120+
with:
121+
name: cli-build-${{ inputs.shell }}-${{ inputs.version }}
122+
123+
- name: Sync versions
124+
run: pnpm exec bun apps/cli/scripts/sync-versions.ts --version ${{ inputs.version }}
125+
126+
- name: Publish to npm
127+
run: pnpm exec bun apps/cli/scripts/publish.ts --tag ${{ inputs.npm_tag }}
128+
env:
129+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
130+
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
131+
132+
- name: Create draft GitHub Release
133+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2
134+
with:
135+
tag_name: v${{ inputs.version }}
136+
name: v${{ inputs.version }}
137+
draft: true
138+
prerelease: ${{ inputs.prerelease }}
139+
files: |
140+
dist/supabase_${{ inputs.version }}_darwin_arm64.tar.gz
141+
dist/supabase_${{ inputs.version }}_darwin_amd64.tar.gz
142+
dist/supabase_${{ inputs.version }}_linux_arm64.tar.gz
143+
dist/supabase_${{ inputs.version }}_linux_amd64.tar.gz
144+
dist/supabase_${{ inputs.version }}_linux_arm64.deb
145+
dist/supabase_${{ inputs.version }}_linux_amd64.deb
146+
dist/supabase_${{ inputs.version }}_linux_arm64.rpm
147+
dist/supabase_${{ inputs.version }}_linux_amd64.rpm
148+
dist/supabase_${{ inputs.version }}_linux_arm64.apk
149+
dist/supabase_${{ inputs.version }}_linux_amd64.apk
150+
dist/supabase_${{ inputs.version }}_windows_amd64.zip
151+
dist/supabase_${{ inputs.version }}_windows_arm64.zip
152+
dist/checksums.txt
153+
154+
- name: Publish GitHub Release (immutable)
155+
env:
156+
GH_TOKEN: ${{ github.token }}
157+
run: gh release edit v${{ inputs.version }} --draft=false
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Stable
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Stable npm package version to publish
8+
required: true
9+
type: string
10+
dry_run:
11+
description: Dry run (skip actual publishing)
12+
required: false
13+
type: boolean
14+
default: true
15+
16+
jobs:
17+
release:
18+
uses: ./.github/workflows/release-shared.yml
19+
with:
20+
version: ${{ inputs.version }}
21+
shell: legacy
22+
npm_tag: latest
23+
prerelease: false
24+
dry_run: ${{ inputs.dry_run }}
25+
secrets: inherit

0 commit comments

Comments
 (0)