Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Release (Beta)

on:
pull_request_review:
types:
- submitted
push:
branches:
- develop
Expand All @@ -13,66 +10,8 @@ permissions:
contents: read

jobs:
approved:
name: fast-forward
if: |
github.event.pull_request.head.ref == 'develop' &&
github.event.pull_request.base.ref == 'main' &&
github.event.review.state == 'approved'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
outputs:
release_tag: ${{ steps.latest-release.outputs.tagName }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- run: |
git checkout main
git merge --ff-only "${{ github.event.pull_request.head.sha }}"
git push origin main
- id: latest-release
run: |
latest=$(gh release list --limit 1 --json tagName --jq '.[].tagName')
gh release edit $latest --latest --prerelease=false
echo "tagName=$latest" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

tag:
name: Move latest tag
needs:
- approved
runs-on: ubuntu-latest
permissions:
contents: read
# Required for npm OIDC
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: latest
registry-url: https://registry.npmjs.org
- run: npm dist-tag add "supabase@${RELEASE_TAG#v}" latest
env:
RELEASE_TAG: ${{ needs.approved.outputs.release_tag }}

deploy:
needs:
- approved
- tag
# Call workflow explicitly because events from actions cannot trigger more actions
uses: ./.github/workflows/release.yml
with:
release: ${{ needs.approved.outputs.release_tag }}
secrets: inherit

release:
name: semantic-release
if: ${{ github.event_name != 'pull_request_review' }}
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
65 changes: 52 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
name: Release

on:
workflow_call:
inputs:
release:
required: true
type: string
workflow_dispatch:
inputs:
release:
description: "v1.0.0"
required: true
type: string
pull_request_review:
types:
- submitted

permissions:
contents: read

jobs:
fast-forward:
if: |
github.event.pull_request.head.ref == 'develop' &&
github.event.pull_request.base.ref == 'main' &&
github.event.review.state == 'approved'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
outputs:
release_tag: ${{ steps.latest-release.outputs.tagName }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- run: |
git checkout main
git merge --ff-only "${{ github.event.pull_request.head.sha }}"
git push origin main
- id: latest-release
run: |
latest=$(gh release list --limit 1 --json tagName --jq '.[].tagName')
gh release edit $latest --latest --prerelease=false
echo "tagName=$latest" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

commit:
name: Publish Brew and Scoop
needs:
- fast-forward
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -35,12 +56,26 @@ jobs:
repositories: |
homebrew-tap
scoop-bucket
- run: go run tools/publish/main.go ${{ inputs.release }}
- run: go run tools/publish/main.go ${{ needs.fast-forward.outputs.release_tag }}
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

publish:
name: Publish NPM
needs:
- fast-forward
permissions:
contents: read
id-token: write
uses: ./.github/workflows/tag-npm.yml
with:
release: ${{ needs.fast-forward.outputs.release_tag }}
secrets: inherit

compose:
name: Bump self-hosted versions
needs:
- fast-forward
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -63,7 +98,9 @@ jobs:
changelog:
name: Publish changelog
needs:
- fast-forward
- commit
- publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -86,6 +123,8 @@ jobs:

docs:
name: Publish reference docs
needs:
- fast-forward
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -101,6 +140,6 @@ jobs:
owner: ${{ github.repository_owner }}
repositories: |
supabase
- run: go run docs/main.go ${{ inputs.release }} | go run tools/bumpdoc/main.go apps/docs/spec/cli_v1_commands.yaml
- run: go run docs/main.go ${{ needs.fast-forward.outputs.release_tag }} | go run tools/bumpdoc/main.go apps/docs/spec/cli_v1_commands.yaml
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
35 changes: 35 additions & 0 deletions .github/workflows/tag-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tag NPM

on:
workflow_call:
inputs:
release:
required: true
type: string
workflow_dispatch:
inputs:
release:
description: "v1.0.0"
required: true
type: string

permissions:
contents: read
id-token: write

jobs:
tag:
name: Move latest tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: actions/setup-node@v6
with:
node-version: latest
registry-url: https://registry.npmjs.org

- run: npm dist-tag add "supabase@${RELEASE_TAG#v}" latest
env:
RELEASE_TAG: ${{ inputs.release }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading