diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5f6cd59e..a6560768d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - main + - develop jobs: test: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 931c828fd..e0d9498bd 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -15,7 +15,7 @@ on: pull_request: push: branches: - - main + - develop jobs: analyze: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..14f4ba63f --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,15 @@ +name: Prod Deploy + +on: + # Run this action every Tuesday at 02:00 UTC (Singapore 10AM) + schedule: + - cron: "0 2 * * 2" + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - run: gh pr create -B main -H develop --title 'Prod deploy' --fill + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index aa5f72d9c..4e6a3a552 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -8,7 +8,7 @@ on: - 'scripts/**' push: branches: - - main + - develop paths: - '.github/workflows/install.yml' - 'package.json' diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 3b67f4a36..32a2089d2 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -3,7 +3,7 @@ name: Release (Beta) on: push: branches: - - main + - develop workflow_dispatch: jobs: @@ -48,8 +48,6 @@ jobs: args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BREWTAP_TOKEN: ${{ secrets.GH_PAT }} - SCOOP_TOKEN: ${{ secrets.GH_PAT }} SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - run: gh release edit v${{ needs.release.outputs.new-release-version }} --draft=false --prerelease @@ -69,7 +67,7 @@ jobs: with: go-version-file: go.mod cache: true - - run: go run tools/publish/main.go --beta "${GITHUB_REF_NAME#v}" + - run: go run tools/publish/main.go --beta "${{ needs.release.outputs.new-release-version }}" env: GITHUB_TOKEN: ${{ secrets.GH_PAT }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0702cb986..4b165ef60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,29 @@ name: Release on: - release: - types: - - released + push: + branches: + - main jobs: + settings: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + outputs: + release_tag: ${{ steps.prerelease.outputs.tagName }} + steps: + - uses: actions/checkout@v4 + - id: prerelease + run: | + gh release list --limit 1 --json tagName --jq \ + '.[]|to_entries|map("\(.key)=\(.value|tostring)")|.[]' >> $GITHUB_OUTPUT + - run: gh release edit ${{ steps.prerelease.outputs.tagName }} --latest + commit: name: Publish Brew and Scoop + needs: + - settings runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -15,12 +31,14 @@ jobs: with: go-version-file: go.mod cache: true - - run: go run tools/publish/main.go "${GITHUB_REF_NAME#v}" + - run: go run tools/publish/main.go ${{ needs.settings.outputs.release_tag }} env: GITHUB_TOKEN: ${{ secrets.GH_PAT }} publish: name: Publish NPM + needs: + - settings runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -28,12 +46,13 @@ jobs: with: node-version: "16.x" registry-url: "https://registry.npmjs.org" - - run: npm dist-tag add "supabase@${GITHUB_REF_NAME#v}" latest + - run: npm dist-tag add "supabase@${RELEASE_TAG#v}" latest env: + RELEASE_TAG: ${{ needs.settings.outputs.release_tag }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} compose: - name: Publish self-hosted + name: Bump self-hosted versions runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -41,12 +60,15 @@ jobs: with: go-version-file: go.mod cache: true - - run: go run tools/selfhost/main.go "cli/$GITHUB_REF_NAME" + - run: go run tools/selfhost/main.go env: GITHUB_TOKEN: ${{ secrets.GH_PAT }} changelog: name: Publish changelog + needs: + - commit + - publish runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -61,6 +83,8 @@ jobs: docs: name: Publish reference docs + needs: + - settings runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -68,6 +92,6 @@ jobs: with: go-version-file: go.mod cache: true - - run: go run docs/main.go "${GITHUB_REF_NAME#v}" | go run tools/bumpdoc/main.go apps/docs/spec/cli_v1_commands.yaml + - run: go run docs/main.go ${{ needs.settings.outputs.release_tag }} | go run tools/bumpdoc/main.go apps/docs/spec/cli_v1_commands.yaml env: GITHUB_TOKEN: ${{ secrets.GH_PAT }} diff --git a/docs/main.go b/docs/main.go index 63d16fd0b..9dc1b9553 100644 --- a/docs/main.go +++ b/docs/main.go @@ -3,6 +3,7 @@ package main import ( "bytes" "embed" + "flag" "fmt" "log" "os" @@ -27,9 +28,11 @@ var ( ) func main() { - semver := "latest" - if len(os.Args) > 1 { - semver = os.Args[1] + semver := flag.Arg(0) + if len(semver) == 0 { + semver = "latest" + } else if semver[0] == 'v' { + semver = semver[1:] } if err := generate(semver); err != nil { diff --git a/go.mod b/go.mod index 6fa37e968..b36fb2275 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/muesli/reflow v0.3.0 github.com/oapi-codegen/runtime v1.1.1 - github.com/slack-go/slack v0.12.4 + github.com/slack-go/slack v0.12.5 github.com/spf13/afero v1.11.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 418168bd9..f63c97688 100644 --- a/go.sum +++ b/go.sum @@ -875,8 +875,8 @@ github.com/sivchari/tenv v1.7.1 h1:PSpuD4bu6fSmtWMxSGWcvqUUgIn7k3yOJhOIzVWn8Ak= github.com/sivchari/tenv v1.7.1/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= -github.com/slack-go/slack v0.12.4 h1:4iLT2opw+/QptmQxBNA7S8pNfSIvtn0NDGu7Jq0emi4= -github.com/slack-go/slack v0.12.4/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= +github.com/slack-go/slack v0.12.5 h1:ddZ6uz6XVaB+3MTDhoW04gG+Vc/M/X1ctC+wssy2cqs= +github.com/slack-go/slack v0.12.5/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00= github.com/sonatard/noctx v0.0.2/go.mod h1:kzFz+CzWSjQ2OzIm46uJZoXuBpa2+0y3T36U18dWqIo= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= diff --git a/internal/start/templates/kong.yml b/internal/start/templates/kong.yml index 3e477291c..ddb87863d 100644 --- a/internal/start/templates/kong.yml +++ b/internal/start/templates/kong.yml @@ -75,16 +75,29 @@ services: add: headers: - "Content-Profile: graphql_public" - - name: realtime-v1 + - name: realtime-v1-ws _comment: "Realtime: /realtime/v1/* -> ws://realtime:4000/socket/*" url: http://{{ .RealtimeId }}:4000/socket + protocol: ws routes: - - name: realtime-v1-all + - name: realtime-v1-ws strip_path: true paths: - /realtime/v1/ plugins: - name: cors + - name: realtime-v1-rest + _comment: "Realtime: /realtime/v1/* -> http://realtime:4000/api/*" + url: http://{{ .RealtimeId }}:4000/api + protocol: http + routes: + - name: realtime-v1-rest + strip_path: true + paths: + - /realtime/v1/api + plugins: + - name: cors + - name: storage-v1 _comment: "Storage: /storage/v1/* -> http://storage-api:5000/*" url: http://{{ .StorageId }}:5000/ diff --git a/internal/utils/misc.go b/internal/utils/misc.go index 5df199027..c0f22645f 100644 --- a/internal/utils/misc.go +++ b/internal/utils/misc.go @@ -34,12 +34,12 @@ const ( PgmetaImage = "supabase/postgres-meta:v0.79.0" StudioImage = "supabase/studio:20240205-b145c86" ImageProxyImage = "darthsim/imgproxy:v3.8.0" - EdgeRuntimeImage = "supabase/edge-runtime:v1.36.7" + EdgeRuntimeImage = "supabase/edge-runtime:v1.38.0" VectorImage = "timberio/vector:0.28.1-alpine" PgbouncerImage = "bitnami/pgbouncer:1.20.1-debian-11-r39" PgProveImage = "supabase/pg_prove:3.36" GotrueImage = "supabase/gotrue:v2.143.0" - RealtimeImage = "supabase/realtime:v2.25.50" + RealtimeImage = "supabase/realtime:v2.25.66" StorageImage = "supabase/storage-api:v0.46.4" LogflareImage = "supabase/logflare:1.4.0" // Should be kept in-sync with EdgeRuntimeImage diff --git a/package.json b/package.json index e701f1785..b7f7f5f3e 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "channel": "hotfix" }, { - "name": "main", + "name": "develop", "channel": "beta" } ], diff --git a/tools/publish/main.go b/tools/publish/main.go index 20afd7b20..86cc5dbc9 100644 --- a/tools/publish/main.go +++ b/tools/publish/main.go @@ -43,6 +43,8 @@ func main() { semver := flag.Arg(0) if len(semver) == 0 { log.Fatalln("Missing required arg: version") + } else if semver[0] == 'v' { + semver = semver[1:] } ctx, _ := signal.NotifyContext(context.Background(), os.Interrupt)