@@ -4,7 +4,7 @@ name: Publish releases
44
55on :
66 push :
7- branches : [master]
7+ branches : [master, feat/use-tsup ]
88 paths-ignore :
99 - ' *.md'
1010 - ' docs/**'
@@ -20,223 +20,16 @@ env:
2020 NODE_VERSION : ' 20'
2121
2222jobs :
23- release-stable : # stable releases can only be manually triggered
24- if : ${{ github.event_name == 'workflow_dispatch' }}
25- runs-on : ubuntu-latest
26- outputs :
27- released_version : ${{ steps.extract-version.outputs.version }}
28- permissions :
29- contents : read
30- id-token : write
31-
32- steps :
33- - name : Generate token
34- id : app-token
35- uses : actions/create-github-app-token@v2
36- with :
37- app-id : ${{ secrets.APP_ID }}
38- private-key : ${{ secrets.PRIVATE_KEY }}
39- - name : Check if actor is member of admin or sdk team
40- id : team-check
41- uses : actions/github-script@v7
42- with :
43- github-token : ${{ steps.app-token.outputs.token }}
44- script : |
45- const org = 'supabase'
46- const { actor } = context
47-
48- async function isTeamMember(team_slug) {
49- try {
50- const res = await github.rest.teams.getMembershipForUserInOrg({
51- org,
52- team_slug,
53- username: actor,
54- })
55- return res && res.status === 200
56- } catch (_) {
57- return false
58- }
59- }
60- const isAdmin = await isTeamMember('admin')
61- const isSdk = await isTeamMember('sdk')
62- const isMember = isAdmin || isSdk
63- core.setOutput('is_team_member', isMember ? 'true' : 'false')
64-
65- - name : Fail if not authorized
66- if : ${{ steps.team-check.outputs.is_team_member != 'true' }}
67- run : |
68- echo "You must be a member of @supabase/admin or @supabase/sdk."
69- exit 1
70-
71- - uses : actions/checkout@v5
72- with :
73- fetch-depth : 0
74-
75- - uses : actions/setup-node@v4
76- with :
77- node-version : ${{ env.NODE_VERSION }}
78- cache : ' npm'
79- registry-url : ' https://registry.npmjs.org'
80-
81- # Ensure npm 11.5.1 or later is installed for trusted publishing support
82- - name : Update npm
83- run : npm install -g npm@latest
84-
85- - name : Install dependencies
86- run : npm ci
87-
88- - name : Configure git
89- run : |
90- git config --global user.name "supabase-releaser[bot]"
91- git config --global user.email "supabase-releaser[bot]@users.noreply.github.com"
92-
93- - name : Validate input
94- run : |
95- VS="${{ github.event.inputs.version_specifier }}"
96- echo "Validating: $VS"
97-
98- if [[ "$VS" =~ ^(patch|minor|major|prepatch|preminor|premajor|prerelease)$ ]]; then
99- echo "✔ bump keyword"
100- elif [[ "$VS" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
101- echo "✔ explicit version"
102- else
103- echo "❌ Invalid version_specifier: '$VS'"
104- echo " Use: patch|minor|major|pre*, or v1.2.3"
105- exit 1
106- fi
107-
108- - name : Release stable version
109- env :
110- NPM_CONFIG_PROVENANCE : true
111- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
112- RELEASE_GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
113- GH_TOKEN : ${{ steps.app-token.outputs.token }}
114- shell : bash
115- run : npm run release-stable -- --versionSpecifier "${{ github.event.inputs.version_specifier }}"
116-
117- - name : Extract released version
118- id : extract-version
119- shell : bash
120- run : |
121- set -euo pipefail
122- VERSION=$(cat .release-version)
123- if [[ -z "$VERSION" ]]; then
124- exit 1
125- fi
126- echo "version=$VERSION" >> $GITHUB_OUTPUT
127-
128- - name : Summary
129- if : ${{ success() }}
130- run : |
131- echo "## ✅ Stable Release" >> $GITHUB_STEP_SUMMARY
132- echo "- **Version specifier:** \`${{ github.event.inputs.version_specifier }}\`" >> $GITHUB_STEP_SUMMARY
133- echo "- **Source commit:** HEAD of the checked-out branch" >> $GITHUB_STEP_SUMMARY
134- echo "- **Dist-tag:** \`latest\`" >> $GITHUB_STEP_SUMMARY
135-
136- docs-after-stable-release :
137- name : Generate Documentation
138- needs : release-stable
139- if : ${{ github.event_name == 'workflow_dispatch' && needs.release-stable.result == 'success' }}
140- uses : ./.github/workflows/docs.yml
141- permissions :
142- actions : read
143- contents : write
144-
145- trigger-update-js-libs :
146- name : Trigger Update JS Libs
147- runs-on : ubuntu-latest
148- needs : release-stable
149- if : ${{ github.event_name == 'workflow_dispatch' && needs.release-stable.result == 'success' }}
150- steps :
151- - name : Generate token
152- id : app-token
153- uses : actions/create-github-app-token@v2
154- with :
155- app-id : ${{ secrets.APP_ID }}
156- private-key : ${{ secrets.PRIVATE_KEY }}
157- owner : supabase
158- repositories : supabase, supabase-js
159- - name : Trigger supabase/supabase update-js-libs workflow
160- uses : actions/github-script@v7
161- with :
162- github-token : ${{ steps.app-token.outputs.token }}
163- script : |
164- await github.rest.actions.createWorkflowDispatch({
165- owner: 'supabase',
166- repo: 'supabase',
167- workflow_id: 'update-js-libs.yml',
168- ref: 'master',
169- inputs: {
170- version: '${{ needs.release-stable.outputs.released_version }}',
171- source: 'supabase-js-stable-release'
172- }
173- });
174-
175- trigger-supabase-docs-update :
176- name : Trigger Supabase Docs Update
177- runs-on : ubuntu-latest
178- needs : [release-stable, docs-after-stable-release]
179- if : ${{ github.event_name == 'workflow_dispatch' && needs.release-stable.result == 'success' && needs.docs-after-stable-release.result == 'success' }}
180- steps :
181- - name : Generate token
182- id : app-token
183- uses : actions/create-github-app-token@v2
184- with :
185- app-id : ${{ secrets.APP_ID }}
186- private-key : ${{ secrets.PRIVATE_KEY }}
187- owner : supabase
188- repositories : supabase, supabase-js
189-
190- - name : Trigger supabase/supabase docs workflow
191- uses : actions/github-script@v7
192- with :
193- github-token : ${{ steps.app-token.outputs.token }}
194- script : |
195- await github.rest.actions.createWorkflowDispatch({
196- owner: 'supabase',
197- repo: 'supabase',
198- workflow_id: 'docs-js-libs-update.yml',
199- ref: 'master',
200- inputs: {
201- version: '${{ needs.release-stable.outputs.released_version }}',
202- source: 'supabase-js-stable-release'
203- }
204- });
205-
206- # preview jobs
207- ci-core :
208- if : ${{ github.event_name == 'push' }}
209- name : Core Packages CI
210- uses : ./.github/workflows/ci-core.yml
211- permissions :
212- actions : read
213- contents : read
214-
215- ci-supabase-js :
216- if : ${{ github.event_name == 'push' }}
217- name : Supabase-JS Integration CI
218- uses : ./.github/workflows/ci-supabase-js.yml
219- permissions :
220- actions : read
221- contents : read
222-
223- # ==========================================
224- # CANARY RELEASE (only on master, after all CI passes)
225- # ==========================================
226-
22723 release-canary :
22824 name : Release Canary
22925 runs-on : ubuntu-latest
230- needs : [ci-core, ci-supabase-js]
23126 permissions :
23227 contents : read
23328 id-token : write
23429 # Only run on master branch pushes, and only if all CI jobs succeeded
23530 if : |
236- github.ref == 'refs/heads/master' &&
237- github.event_name == 'push' &&
238- needs.ci-core.result == 'success' &&
239- needs.ci-supabase-js.result == 'success'
31+ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/feat/use-tsup') &&
32+ github.event_name == 'push'
24033 steps :
24134 - name : Generate token
24235 id : app-token
@@ -276,34 +69,3 @@ jobs:
27669 NPM_CONFIG_PROVENANCE : true
27770 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
27871 RELEASE_GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
279-
280- notify-stable-failure :
281- name : Notify Slack for Stable failure
282- needs : release-stable
283- if : ${{ always() && github.event_name == 'workflow_dispatch' && needs.release-stable.result == 'failure' }}
284- uses : ./.github/workflows/slack-notify.yml
285- secrets : inherit
286- with :
287- title : ' Stable Release'
288- status : ' failure'
289-
290- notify-stable-success :
291- name : Notify Slack for Stable success
292- needs : release-stable
293- if : ${{ github.event_name == 'workflow_dispatch' && needs.release-stable.result == 'success' }}
294- uses : ./.github/workflows/slack-notify.yml
295- secrets : inherit
296- with :
297- title : ' Stable Release'
298- status : ' success'
299- version : ${{ needs.release-stable.outputs.released_version }}
300-
301- notify-canary-failure :
302- name : Notify Slack for Canary failure
303- needs : release-canary
304- if : ${{ always() && github.event_name == 'push' && needs.release-canary.result == 'failure' }}
305- uses : ./.github/workflows/slack-notify.yml
306- secrets : inherit
307- with :
308- title : ' Canary Release'
309- status : ' failure'
0 commit comments