6
6
push :
7
7
branches : [master]
8
8
workflow_dispatch :
9
- inputs :
10
- version_specifier :
11
- description : ' Semver bump (patch|minor|major|pre*) or exact version (v1.2.3)'
12
- required : true
13
- type : string
14
9
15
10
env :
16
11
NODE_VERSION : ' 20'
30
25
with :
31
26
app-id : ${{ secrets.APP_ID }}
32
27
private-key : ${{ secrets.PRIVATE_KEY }}
33
- - name : Check if actor is member of admin or client-libs team
34
- id : team-check
35
- uses : actions/github-script@v7
36
- with :
37
- github-token : ${{ steps.app-token.outputs.token }}
38
- script : |
39
- const org = 'supabase'
40
- const { actor } = context
41
-
42
- async function isTeamMember(team_slug) {
43
- try {
44
- const res = await github.rest.teams.getMembershipForUserInOrg({
45
- org,
46
- team_slug,
47
- username: actor,
48
- })
49
- console.log('res', JSON.stringify(res, null, 2))
50
- return res && res.status === 200
51
- } catch (_) {
52
- return false
53
- }
54
- }
55
-
56
- const isAdmin = await isTeamMember('admin')
57
- const isClientLibs = await isTeamMember('client-libs')
58
- const isMember = isAdmin || isClientLibs
59
- console.log('isAdmin', isAdmin)
60
- console.log('isClientLibs', isClientLibs)
61
- console.log('isMember', isMember)
62
- core.setOutput('is_team_member', isMember ? 'true' : 'false')
63
-
64
- - name : Fail if not authorized
65
- if : ${{ steps.team-check.outputs.is_team_member != 'true' }}
66
- run : |
67
- echo "You must be a member of @supabase/admin or @supabase/client-libs."
68
- exit 1
69
28
70
29
- uses : actions/checkout@v5
71
30
with :
@@ -87,36 +46,21 @@ jobs:
87
46
git config --global user.name "supabase-releaser[bot]"
88
47
git config --global user.email "supabase-releaser[bot]@users.noreply.github.com"
89
48
90
- - name : Validate input
91
- run : |
92
- VS="${{ github.event.inputs.version_specifier }}"
93
- echo "Validating: $VS"
94
-
95
- if [[ "$VS" =~ ^(patch|minor|major|prepatch|preminor|premajor|prerelease)$ ]]; then
96
- echo "✔ bump keyword"
97
- elif [[ "$VS" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
98
- echo "✔ explicit version"
99
- else
100
- echo "❌ Invalid version_specifier: '$VS'"
101
- echo " Use: patch|minor|major|pre*, or v1.2.3"
102
- exit 1
103
- fi
104
-
105
49
- name : Set git remote to use App token
106
50
run : git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/supabase/supabase-js.git
107
-
51
+
108
52
- name : Authenticate gh CLI with App token
109
53
env :
110
54
GH_TOKEN : ${{ steps.app-token.outputs.token }}
111
55
run : |
112
- gh auth login --with-token
113
-
56
+ gh auth login --with-token
57
+
114
58
- name : Create and push branch with gh CLI
115
59
run : |
116
60
git checkout --orphan test-token-push
117
61
git commit --allow-empty -m "chore(repo): test push"
118
62
git push origin test-token-push
119
-
63
+
120
64
- name : Create pull request with gh CLI
121
65
run : |
122
66
gh pr create \
@@ -131,14 +75,7 @@ jobs:
131
75
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
132
76
RELEASE_GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
133
77
run : |
134
- npm run release-stable -- --versionSpecifier "${{ github.event.inputs.version_specifier }}"
135
- - name : Summary
136
- if : ${{ success() }}
137
- run : |
138
- echo "## ✅ Stable Release" >> $GITHUB_STEP_SUMMARY
139
- echo "- **Version specifier:** \`${{ github.event.inputs.version_specifier }}\`" >> $GITHUB_STEP_SUMMARY
140
- echo "- **Source commit:** HEAD of the checked-out branch" >> $GITHUB_STEP_SUMMARY
141
- echo "- **Dist-tag:** \`latest\`" >> $GITHUB_STEP_SUMMARY
78
+ npm run release-stable
142
79
143
80
trigger-update-js-libs :
144
81
name : Trigger Update JS Libs
@@ -201,4 +138,4 @@ jobs:
201
138
version: '2.74.0',
202
139
source: 'supabase-js-stable-release'
203
140
}
204
- });
141
+ });
0 commit comments