Skip to content

Commit bf3b860

Browse files
committed
Revert "chore: move all npm ops to beta workflow"
This reverts commit eae61bf.
1 parent eae61bf commit bf3b860

File tree

3 files changed

+79
-44
lines changed

3 files changed

+79
-44
lines changed

.github/workflows/release-beta.yml

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,13 @@ permissions:
1414

1515
jobs:
1616
approved:
17-
name: fast-forward
1817
if: |
1918
github.event.pull_request.head.ref == 'develop' &&
2019
github.event.pull_request.base.ref == 'main' &&
2120
github.event.review.state == 'approved'
2221
runs-on: ubuntu-latest
2322
permissions:
2423
contents: write
25-
packages: write
26-
outputs:
27-
release_tag: ${{ steps.latest-release.outputs.tagName }}
2824
steps:
2925
- uses: actions/checkout@v6
3026
with:
@@ -33,46 +29,21 @@ jobs:
3329
git checkout main
3430
git merge --ff-only "${{ github.event.pull_request.head.sha }}"
3531
git push origin main
36-
- id: latest-release
37-
run: |
38-
latest=$(gh release list --limit 1 --json tagName --jq '.[].tagName')
39-
gh release edit $latest --latest --prerelease=false
40-
echo "tagName=$latest" >> $GITHUB_OUTPUT
41-
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4332
44-
tag:
45-
name: Move latest tag
33+
deploy:
4634
needs:
4735
- approved
48-
runs-on: ubuntu-latest
4936
permissions:
50-
contents: read
37+
contents: write
38+
packages: write
5139
# Required for npm OIDC
5240
id-token: write
53-
steps:
54-
- uses: actions/checkout@v6
55-
- uses: actions/setup-node@v6
56-
with:
57-
node-version: latest
58-
registry-url: https://registry.npmjs.org
59-
- run: npm dist-tag add "supabase@${RELEASE_TAG#v}" latest
60-
env:
61-
RELEASE_TAG: ${{ needs.approved.outputs.release_tag }}
62-
63-
deploy:
64-
needs:
65-
- approved
66-
- tag
6741
# Call workflow explicitly because events from actions cannot trigger more actions
6842
uses: ./.github/workflows/release.yml
69-
with:
70-
release: ${{ needs.approved.outputs.release_tag }}
7143
secrets: inherit
7244

7345
release:
7446
name: semantic-release
75-
if: ${{ github.event_name != 'pull_request_review' }}
7647
runs-on: ubuntu-latest
7748
permissions:
7849
contents: write

.github/workflows/release.yml

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
11
name: Release
22

33
on:
4+
push:
5+
branches:
6+
- main
47
workflow_call:
5-
inputs:
6-
release:
7-
required: true
8-
type: string
9-
workflow_dispatch:
10-
inputs:
11-
release:
12-
description: "v1.0.0"
13-
required: true
14-
type: string
158

169
permissions:
1710
contents: read
1811

1912
jobs:
13+
settings:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
packages: write
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
outputs:
21+
release_tag: ${{ steps.prerelease.outputs.tagName }}
22+
steps:
23+
- uses: actions/checkout@v6
24+
- id: prerelease
25+
run: |
26+
gh release list --limit 1 --json tagName --jq \
27+
'.[]|to_entries|map("\(.key)=\(.value|tostring)")|.[]' >> $GITHUB_OUTPUT
28+
- run: gh release edit ${{ steps.prerelease.outputs.tagName }} --latest --prerelease=false
29+
2030
commit:
2131
name: Publish Brew and Scoop
32+
needs:
33+
- settings
2234
runs-on: ubuntu-latest
2335
steps:
2436
- uses: actions/checkout@v6
@@ -35,12 +47,26 @@ jobs:
3547
repositories: |
3648
homebrew-tap
3749
scoop-bucket
38-
- run: go run tools/publish/main.go ${{ inputs.release }}
50+
- run: go run tools/publish/main.go ${{ needs.settings.outputs.release_tag }}
3951
env:
4052
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4153

54+
publish:
55+
name: Publish NPM
56+
needs:
57+
- settings
58+
permissions:
59+
contents: read
60+
id-token: write
61+
uses: ./.github/workflows/tag-npm.yml
62+
with:
63+
release: ${{ needs.settings.outputs.release_tag }}
64+
secrets: inherit
65+
4266
compose:
4367
name: Bump self-hosted versions
68+
needs:
69+
- settings
4470
runs-on: ubuntu-latest
4571
steps:
4672
- uses: actions/checkout@v6
@@ -63,7 +89,9 @@ jobs:
6389
changelog:
6490
name: Publish changelog
6591
needs:
92+
- settings
6693
- commit
94+
- publish
6795
runs-on: ubuntu-latest
6896
steps:
6997
- uses: actions/checkout@v6
@@ -86,6 +114,8 @@ jobs:
86114

87115
docs:
88116
name: Publish reference docs
117+
needs:
118+
- settings
89119
runs-on: ubuntu-latest
90120
steps:
91121
- uses: actions/checkout@v6
@@ -101,6 +131,6 @@ jobs:
101131
owner: ${{ github.repository_owner }}
102132
repositories: |
103133
supabase
104-
- run: go run docs/main.go ${{ inputs.release }} | go run tools/bumpdoc/main.go apps/docs/spec/cli_v1_commands.yaml
134+
- run: go run docs/main.go ${{ needs.settings.outputs.release_tag }} | go run tools/bumpdoc/main.go apps/docs/spec/cli_v1_commands.yaml
105135
env:
106136
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

.github/workflows/tag-npm.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Tag NPM
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
release:
7+
required: true
8+
type: string
9+
workflow_dispatch:
10+
inputs:
11+
release:
12+
description: "v1.0.0"
13+
required: true
14+
type: string
15+
16+
permissions:
17+
contents: read
18+
id-token: write
19+
20+
jobs:
21+
tag:
22+
name: Move latest tag
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v6
26+
27+
- uses: actions/setup-node@v6
28+
with:
29+
node-version: latest
30+
registry-url: https://registry.npmjs.org
31+
32+
- run: npm dist-tag add "supabase@${RELEASE_TAG#v}" latest
33+
env:
34+
RELEASE_TAG: ${{ inputs.release }}

0 commit comments

Comments
 (0)