Skip to content

Commit b6ad4b8

Browse files
feat: v2.6.0
1 parent 12fda7d commit b6ad4b8

65 files changed

Lines changed: 1636 additions & 367 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/workflows/prod.yml

Lines changed: 8 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,154 +1,18 @@
1-
name: MT Deploy Production
1+
name: Deploy Production
22
on:
3-
push:
4-
branches:
5-
- release
6-
3+
pull_request:
4+
types: [closed]
5+
branches:
6+
- 'releases/latest'
7+
78
jobs:
8-
release:
9-
runs-on: ubuntu-20.04
10-
outputs:
11-
published: ${{ steps.semantic.outputs.new_release_published }}
12-
version: ${{ steps.semantic.outputs.new_release_version }}
13-
steps:
14-
- uses: actions/checkout@v3
15-
- id: semantic
16-
uses: cycjimmy/semantic-release-action@v3
17-
with:
18-
semantic_version: 18
19-
env:
20-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ACTION }}
21-
229
deploy:
23-
needs: release
10+
if: github.event.pull_request.merged == true
2411
runs-on: ubuntu-20.04
25-
if: needs.release.outputs.published == 'true'
2612
steps:
2713
- uses: actions/checkout@v2
2814
- uses: superfly/flyctl-actions@1.1
2915
with:
3016
args: "-c deploy/fly/prod.toml deploy --build-arg SLOT_NAME_SUFFIX=${GITHUB_SHA::7}"
3117
env:
32-
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
33-
34-
docker_x86_release:
35-
needs: release
36-
runs-on: ubuntu-20.04
37-
if: needs.release.outputs.published == 'true'
38-
timeout-minutes: 120
39-
env:
40-
arch: amd64
41-
outputs:
42-
image_digest: ${{ steps.build.outputs.digest }}
43-
steps:
44-
- id: meta
45-
uses: docker/metadata-action@v4
46-
with:
47-
images: |
48-
supabase/realtime
49-
tags: |
50-
type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }}
51-
52-
- uses: docker/setup-buildx-action@v2
53-
54-
- uses: docker/login-action@v2
55-
with:
56-
username: ${{ secrets.DOCKER_USERNAME }}
57-
password: ${{ secrets.DOCKER_PASSWORD }}
58-
59-
- id: build
60-
uses: docker/build-push-action@v3
61-
with:
62-
push: true
63-
tags: ${{ steps.meta.outputs.tags }}
64-
platforms: linux/${{ env.arch }}
65-
cache-from: type=gha
66-
cache-to: type=gha,mode=max
67-
68-
docker_arm_release:
69-
needs: release
70-
runs-on: arm-runner
71-
if: needs.release.outputs.published == 'true'
72-
timeout-minutes: 120
73-
env:
74-
arch: arm64
75-
outputs:
76-
image_digest: ${{ steps.build.outputs.digest }}
77-
steps:
78-
- uses: actions/checkout@v3
79-
80-
- id: meta
81-
uses: docker/metadata-action@v4
82-
with:
83-
images: |
84-
supabase/realtime
85-
tags: |
86-
type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }}
87-
88-
- uses: docker/login-action@v2
89-
with:
90-
username: ${{ secrets.DOCKER_USERNAME }}
91-
password: ${{ secrets.DOCKER_PASSWORD }}
92-
93-
- uses: docker/setup-buildx-action@v2
94-
with:
95-
driver: docker
96-
driver-opts: |
97-
image=moby/buildkit:master
98-
network=host
99-
100-
- id: build
101-
uses: docker/build-push-action@v3
102-
with:
103-
context: .
104-
push: true
105-
tags: ${{ steps.meta.outputs.tags }}
106-
platforms: linux/${{ env.arch }}
107-
no-cache: true
108-
109-
merge_manifest:
110-
needs: [release, docker_x86_release, docker_arm_release]
111-
runs-on: ubuntu-latest
112-
permissions:
113-
contents: read
114-
packages: write
115-
id-token: write
116-
steps:
117-
- uses: docker/setup-buildx-action@v2
118-
119-
- uses: docker/login-action@v2
120-
with:
121-
username: ${{ secrets.DOCKER_USERNAME }}
122-
password: ${{ secrets.DOCKER_PASSWORD }}
123-
124-
- name: Merge multi-arch manifests
125-
run: |
126-
docker buildx imagetools create -t supabase/realtime:v${{ needs.release.outputs.version }} \
127-
supabase/realtime@${{ needs.docker_x86_release.outputs.image_digest }} \
128-
supabase/realtime@${{ needs.docker_arm_release.outputs.image_digest }}
129-
130-
- name: configure aws credentials
131-
uses: aws-actions/configure-aws-credentials@v1
132-
with:
133-
role-to-assume: ${{ secrets.PROD_AWS_ROLE }}
134-
aws-region: us-east-1
135-
136-
- name: Login to ECR
137-
uses: docker/login-action@v2
138-
with:
139-
registry: public.ecr.aws
140-
141-
- name: Login to GHCR
142-
uses: docker/login-action@v2
143-
with:
144-
registry: ghcr.io
145-
username: ${{ github.actor }}
146-
password: ${{ secrets.GITHUB_TOKEN }}
147-
148-
- name: Mirror to ECR
149-
uses: akhilerm/tag-push-action@v2.0.0
150-
with:
151-
src: docker.io/supabase/realtime:v${{ needs.release.outputs.version }}
152-
dst: |
153-
public.ecr.aws/supabase/realtime:v${{ needs.release.outputs.version }}
154-
ghcr.io/supabase/realtime:v${{ needs.release.outputs.version }}
18+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

.github/workflows/prod_build.yml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
name: Build Production
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
jobs:
7+
release:
8+
runs-on: ubuntu-20.04
9+
outputs:
10+
published: ${{ steps.semantic.outputs.new_release_published }}
11+
version: ${{ steps.semantic.outputs.new_release_version }}
12+
steps:
13+
- uses: actions/checkout@v3
14+
- id: semantic
15+
uses: cycjimmy/semantic-release-action@v3
16+
with:
17+
semantic_version: 18
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ACTION }}
20+
21+
docker_x86_release:
22+
needs: release
23+
runs-on: ubuntu-20.04
24+
if: needs.release.outputs.published == 'true'
25+
timeout-minutes: 120
26+
env:
27+
arch: amd64
28+
outputs:
29+
image_digest: ${{ steps.build.outputs.digest }}
30+
steps:
31+
- id: meta
32+
uses: docker/metadata-action@v4
33+
with:
34+
images: |
35+
supabase/realtime
36+
tags: |
37+
type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }}
38+
39+
- uses: docker/setup-buildx-action@v2
40+
41+
- uses: docker/login-action@v2
42+
with:
43+
username: ${{ secrets.DOCKER_USERNAME }}
44+
password: ${{ secrets.DOCKER_PASSWORD }}
45+
46+
- id: build
47+
uses: docker/build-push-action@v3
48+
with:
49+
push: true
50+
tags: ${{ steps.meta.outputs.tags }}
51+
platforms: linux/${{ env.arch }}
52+
cache-from: type=gha
53+
cache-to: type=gha,mode=max
54+
55+
docker_arm_release:
56+
needs: release
57+
runs-on: arm-runner
58+
if: needs.release.outputs.published == 'true'
59+
timeout-minutes: 120
60+
env:
61+
arch: arm64
62+
outputs:
63+
image_digest: ${{ steps.build.outputs.digest }}
64+
steps:
65+
- uses: actions/checkout@v3
66+
67+
- id: meta
68+
uses: docker/metadata-action@v4
69+
with:
70+
images: |
71+
supabase/realtime
72+
tags: |
73+
type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }}
74+
75+
- uses: docker/login-action@v2
76+
with:
77+
username: ${{ secrets.DOCKER_USERNAME }}
78+
password: ${{ secrets.DOCKER_PASSWORD }}
79+
80+
- uses: docker/setup-buildx-action@v2
81+
with:
82+
driver: docker
83+
driver-opts: |
84+
image=moby/buildkit:master
85+
network=host
86+
87+
- id: build
88+
uses: docker/build-push-action@v3
89+
with:
90+
context: .
91+
push: true
92+
tags: ${{ steps.meta.outputs.tags }}
93+
platforms: linux/${{ env.arch }}
94+
no-cache: true
95+
96+
merge_manifest:
97+
needs: [release, docker_x86_release, docker_arm_release]
98+
runs-on: ubuntu-latest
99+
permissions:
100+
contents: read
101+
packages: write
102+
id-token: write
103+
steps:
104+
- uses: docker/setup-buildx-action@v2
105+
106+
- uses: docker/login-action@v2
107+
with:
108+
username: ${{ secrets.DOCKER_USERNAME }}
109+
password: ${{ secrets.DOCKER_PASSWORD }}
110+
111+
- name: Merge multi-arch manifests
112+
run: |
113+
docker buildx imagetools create -t supabase/realtime:v${{ needs.release.outputs.version }} \
114+
supabase/realtime@${{ needs.docker_x86_release.outputs.image_digest }} \
115+
supabase/realtime@${{ needs.docker_arm_release.outputs.image_digest }}
116+
117+
- name: configure aws credentials
118+
uses: aws-actions/configure-aws-credentials@v1
119+
with:
120+
role-to-assume: ${{ secrets.PROD_AWS_ROLE }}
121+
aws-region: us-east-1
122+
123+
- name: Login to ECR
124+
uses: docker/login-action@v2
125+
with:
126+
registry: public.ecr.aws
127+
128+
- name: Login to GHCR
129+
uses: docker/login-action@v2
130+
with:
131+
registry: ghcr.io
132+
username: ${{ github.actor }}
133+
password: ${{ secrets.GITHUB_TOKEN }}
134+
135+
- name: Mirror to ECR
136+
uses: akhilerm/tag-push-action@v2.0.0
137+
with:
138+
src: docker.io/supabase/realtime:v${{ needs.release.outputs.version }}
139+
dst: |
140+
public.ecr.aws/supabase/realtime:v${{ needs.release.outputs.version }}
141+
ghcr.io/supabase/realtime:v${{ needs.release.outputs.version }}
142+
143+
update-branch-name:
144+
needs: [release, docker_x86_release, docker_arm_release, merge_manifest]
145+
runs-on: ubuntu-latest
146+
steps:
147+
- name: Checkout branch
148+
uses: actions/checkout@v2
149+
with:
150+
ref: refs/heads/main
151+
- name: Update branch name
152+
run: |
153+
git branch -m main releases/v${{ needs.release.outputs.version }}
154+
git push origin HEAD:releases/v${{ needs.release.outputs.version }}

.github/workflows/prod_linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: MT Production Formatting Checks
1+
name: Production Formatting Checks
22
on:
33
pull_request:
44
branches:

.github/workflows/staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: MT Deploy Staging
1+
name: Deploy Staging
22
on:
33
push:
44
branches:

.github/workflows/staging_linter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: MT Staging Formatting Checks
1+
name: Staging Formatting Checks
22
on:
33
pull_request:
44
branches:
@@ -31,7 +31,7 @@ jobs:
3131
- name: Run main database migrations
3232
run: mix ecto.migrate --log-migrator-sql
3333
- name: Run database tenant migrations
34-
run: mix ecto.migrate --migrations-path priv/repo/postgres/migrations
34+
run: mix ecto.migrate --migrations-path lib/extensions/postgres_cdc_rls/repo/migrations
3535
- name: Run format check
3636
run: mix format --check-formatted
3737
- name: Credo checks

.github/workflows/staging_tealbench.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: MT Tealbench
1+
name: Tealbench
22
on:
33
push:
44
branches:
@@ -28,4 +28,4 @@ jobs:
2828
curl --request POST \
2929
--url https://Tealbench.fly.dev/api/runs \
3030
--header 'Authorization: User ${{ secrets.BENCHMARK_JWT }}' \
31-
--data '{"benchmark_id":"SyMKxU3TOiWcAvU","name":"PR ${{ env.PR_NUM }}","comment": "https://github.com/supabase/realtime/pull/${{ env.PR_NUM }}", "origin":"main"}'
31+
--data '{"benchmark_id":"SyMKxU3TOiWcAvU","name":"PR ${{ env.PR_NUM }}","comment": "https://github.com/Tealbase/realtime/pull/${{ env.PR_NUM }}", "origin":"main"}'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on:
2+
pull_request:
3+
types: [opened, reopened, synchronize]
4+
branches:
5+
- 'main'
6+
7+
name: Default Checks
8+
9+
jobs:
10+
versions_updated:
11+
name: Versions Updated
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Verify Versions Updated
18+
uses: tj-actions/changed-files@v35
19+
id: verify_changed_files
20+
with:
21+
files: |
22+
mix.exs
23+
24+
- name: Fail Unless Versions Updated
25+
id: fail_unless_changed
26+
if: steps.verify_changed_files.outputs.any_changed == 'false'
27+
run: |
28+
echo "::error ::Please update the mix.exs version"
29+
exit 1

0 commit comments

Comments
 (0)