@@ -40,28 +40,11 @@ if (!validSpecifiers.includes(versionSpecifier) && !isValidVersion) {
40
40
}
41
41
42
42
; ( async ( ) => {
43
- // const { workspaceVersion, projectsVersionData } = await releaseVersion({
44
- // verbose: true,
45
- // gitCommit: false,
46
- // stageChanges: false,
47
- // specifier: versionSpecifier,
48
- // })
49
-
50
43
if ( process . env . RELEASE_GITHUB_TOKEN ) {
51
44
const remoteUrl = `https://x-access-token:${ process . env . RELEASE_GITHUB_TOKEN } @github.com/supabase/supabase-js.git`
52
45
execSync ( `git remote set-url origin "${ remoteUrl } "` )
53
- console . log ( 'Set origin to:' , remoteUrl )
54
46
}
55
47
56
- // Update version.ts files with the new versions
57
- console . log ( '\n📦 Updating version.ts files...' )
58
- // execSync('npx tsx scripts/update-version-files.ts', { stdio: 'inherit' })
59
-
60
- // Rebuild packages with correct versions
61
- console . log ( '\n🔨 Rebuilding packages with new versions...' )
62
- // execSync('npx nx run-many --target=build --all', { stdio: 'inherit' })
63
- console . log ( '✅ Build complete\n' )
64
-
65
48
// releaseChangelog should use the GitHub token with permission for tagging
66
49
// before switching the token, backup the GITHUB_TOKEN so that it
67
50
// can be restored afterwards and used by releasePublish. We can't use the same
@@ -77,53 +60,15 @@ if (!validSpecifiers.includes(versionSpecifier) && !isValidVersion) {
77
60
const authHeader = `AUTHORIZATION: basic ${ Buffer . from ( `x-access-token:${ process . env . RELEASE_GITHUB_TOKEN } ` ) . toString ( 'base64' ) } `
78
61
execSync ( `git config --local http.https://github.com/.extraheader "${ authHeader } "` )
79
62
80
- // const result = await releaseChangelog({
81
- // versionData: projectsVersionData,
82
- // version: workspaceVersion,
83
- // verbose: true,
84
- // gitCommit: false,
85
- // stageChanges: false,
86
- // })
87
-
88
63
// npm publish with OIDC
89
64
// not strictly necessary to restore the header but do it incase we require it later
90
65
execSync ( `git config --local http.https://github.com/.extraheader "${ originalAuth } "` )
91
66
// restore the GH token
92
67
process . env . GITHUB_TOKEN = gh_token_bak
93
68
94
- // const publishResult = await releasePublish({
95
- // registry: 'https://registry.npmjs.org/',
96
- // access: 'public',
97
- // tag: 'latest',
98
- // verbose: true,
99
- // })
100
-
101
- // Publish gotrue-js as legacy mirror of auth-js
102
- // console.log('\n📦 Publishing @supabase/gotrue-js (legacy mirror)...')
103
- // try {
104
- // execSync('npx tsx scripts/publish-gotrue-legacy.ts --tag=latest', { stdio: 'inherit' })
105
- // } catch (error) {
106
- // console.error('❌ Failed to publish gotrue-js legacy package:', error)
107
- // // Don't fail the entire release if gotrue-js fails
108
- // console.log('⚠️ Continuing with release despite gotrue-js publish failure')
109
- // }
110
-
111
69
// ---- Create release branch + PR ----
112
70
// switch back to the releaser GitHub token
113
71
process . env . GITHUB_TOKEN = process . env . RELEASE_GITHUB_TOKEN
114
- // const version = result.workspaceChangelog?.releaseVersion.rawVersion || workspaceVersion
115
-
116
- // Validate version to prevent command injection
117
- // Version should match semver pattern or be a valid npm version specifier
118
- // if (
119
- // !version ||
120
- // !/^(v?\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?|patch|minor|major|prepatch|preminor|premajor|prerelease)$/.test(
121
- // version
122
- // )
123
- // ) {
124
- // console.error(`❌ Invalid version format: ${version}`)
125
- // process.exit(1)
126
- // }
127
72
128
73
const branchName = `release-test}`
129
74
@@ -145,8 +90,6 @@ if (!validSpecifiers.includes(versionSpecifier) && !isValidVersion) {
145
90
execSync ( `git remote set-url origin "${ remoteUrl } "` )
146
91
}
147
92
148
- console . log ( 'Remote config before push:' )
149
- console . log ( execSync ( 'git remote -v' ) . toString ( ) )
150
93
execSync ( `git push origin ${ branchName } ` )
151
94
152
95
// Open PR using GitHub CLI
@@ -157,12 +100,7 @@ if (!validSpecifiers.includes(versionSpecifier) && !isValidVersion) {
157
100
158
101
// Enable auto-merge
159
102
execSync ( `gh pr merge --auto --squash` , { stdio : 'inherit' } )
160
-
161
- // execSync('git stash')
162
- // console.log('✅ Stashed package.json changes')
163
103
} catch ( err ) {
164
104
console . error ( '❌ Failed to push release branch or open PR' , err )
165
105
}
166
-
167
- // process.exit(Object.values(publishResult).every((r) => r.code === 0) ? 0 : 1)
168
106
} ) ( )
0 commit comments