Skip to content

Commit d79ae89

Browse files
committed
chore(ci): only test permissions
1 parent d792f52 commit d79ae89

File tree

2 files changed

+1
-175
lines changed

2 files changed

+1
-175
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,6 @@ jobs:
140140
echo "- **Source commit:** HEAD of the checked-out branch" >> $GITHUB_STEP_SUMMARY
141141
echo "- **Dist-tag:** \`latest\`" >> $GITHUB_STEP_SUMMARY
142142
143-
# docs-after-stable-release:
144-
# name: Generate Documentation
145-
# needs: release-stable
146-
# if: ${{
147-
# github.event_name == 'workflow_dispatch' &&
148-
# needs.release-stable.result == 'success'
149-
# }}
150-
# uses: ./.github/workflows/docs.yml
151-
# permissions:
152-
# actions: read
153-
# contents: write
154-
155143
trigger-update-js-libs:
156144
name: Trigger Update JS Libs
157145
runs-on: ubuntu-latest
@@ -213,104 +201,4 @@ jobs:
213201
version: '2.74.0',
214202
source: 'supabase-js-stable-release'
215203
}
216-
});
217-
218-
# preview jobs
219-
# ci-core:
220-
# if: ${{ github.event_name == 'push' }}
221-
# name: Core Packages CI
222-
# uses: ./.github/workflows/ci-core.yml
223-
# permissions:
224-
# actions: read
225-
# contents: read
226-
227-
# ci-supabase-js:
228-
# if: ${{ github.event_name == 'push' }}
229-
# name: Supabase-JS Integration CI
230-
# uses: ./.github/workflows/ci-supabase-js.yml
231-
# permissions:
232-
# actions: read
233-
# contents: read
234-
235-
# ci-auth-js-node18:
236-
# if: ${{ github.event_name == 'push' }}
237-
# name: Auth-JS Node.js 18 Compatibility
238-
# uses: ./.github/workflows/ci-auth-js-node18.yml
239-
# permissions:
240-
# actions: read
241-
# contents: read
242-
243-
# ==========================================
244-
# CANARY RELEASE (only on master, after all CI passes)
245-
# ==========================================
246-
247-
# release-canary:
248-
# name: Release Canary
249-
# runs-on: ubuntu-latest
250-
# needs: [ci-core, ci-supabase-js, ci-auth-js-node18]
251-
# permissions:
252-
# contents: read
253-
# id-token: write
254-
# # Only run on master branch pushes, and only if all CI jobs succeeded
255-
# if: |
256-
# github.ref == 'refs/heads/master' &&
257-
# github.event_name == 'push' &&
258-
# needs.ci-core.result == 'success' &&
259-
# needs.ci-supabase-js.result == 'success' &&
260-
# needs.ci-auth-js-node18.result == 'success'
261-
# steps:
262-
# - name: Generate token
263-
# id: app-token
264-
# uses: actions/create-github-app-token@v2
265-
# with:
266-
# app-id: ${{ secrets.APP_ID }}
267-
# private-key: ${{ secrets.PRIVATE_KEY }}
268-
269-
# - name: Checkout code
270-
# uses: actions/checkout@v5
271-
# with:
272-
# fetch-depth: 0
273-
274-
# - name: Setup Node.js
275-
# uses: actions/setup-node@v4
276-
# with:
277-
# node-version: ${{ env.NODE_VERSION }}
278-
# cache: 'npm'
279-
# registry-url: 'https://registry.npmjs.org'
280-
281-
# # Ensure npm 11.5.1 or later is installed for trusted publishing support
282-
# - name: Update npm
283-
# run: npm install -g npm@latest
284-
# - name: Install dependencies
285-
# run: npm ci --legacy-peer-deps
286-
# - name: Configure git
287-
# run: |
288-
# git config --global user.name "supabase-releaser[bot]"
289-
# git config --global user.email "supabase-releaser[bot]@users.noreply.github.com"
290-
291-
# - name: Release canary version
292-
# id: release
293-
# run: |
294-
# echo "Running nx release..."
295-
# npm run release-canary
296-
# env:
297-
# NPM_CONFIG_PROVENANCE: true
298-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
299-
# RELEASE_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} # used for tags
300-
# notify-stable-failure:
301-
# name: Notify Slack for Stable failure
302-
# needs: release-stable
303-
# if: ${{ always() && github.event_name == 'workflow_dispatch' && needs.release-stable.result == 'failure' }}
304-
# uses: ./.github/workflows/slack-notify.yml
305-
# secrets: inherit
306-
# with:
307-
# subject: 'Stable Release'
308-
309-
# notify-canary-failure:
310-
# name: Notify Slack for Canary failure
311-
# needs: release-canary
312-
# if: ${{ always() && github.event_name == 'push' && needs.release-canary.result == 'failure' }}
313-
# uses: ./.github/workflows/slack-notify.yml
314-
# secrets: inherit
315-
# with:
316-
# subject: 'Canary Release'
204+
});

scripts/release-stable.ts

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,11 @@ if (!validSpecifiers.includes(versionSpecifier) && !isValidVersion) {
4040
}
4141

4242
;(async () => {
43-
// const { workspaceVersion, projectsVersionData } = await releaseVersion({
44-
// verbose: true,
45-
// gitCommit: false,
46-
// stageChanges: false,
47-
// specifier: versionSpecifier,
48-
// })
49-
5043
if (process.env.RELEASE_GITHUB_TOKEN) {
5144
const remoteUrl = `https://x-access-token:${process.env.RELEASE_GITHUB_TOKEN}@github.com/supabase/supabase-js.git`
5245
execSync(`git remote set-url origin "${remoteUrl}"`)
53-
console.log('Set origin to:', remoteUrl)
5446
}
5547

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-
6548
// releaseChangelog should use the GitHub token with permission for tagging
6649
// before switching the token, backup the GITHUB_TOKEN so that it
6750
// can be restored afterwards and used by releasePublish. We can't use the same
@@ -77,53 +60,15 @@ if (!validSpecifiers.includes(versionSpecifier) && !isValidVersion) {
7760
const authHeader = `AUTHORIZATION: basic ${Buffer.from(`x-access-token:${process.env.RELEASE_GITHUB_TOKEN}`).toString('base64')}`
7861
execSync(`git config --local http.https://github.com/.extraheader "${authHeader}"`)
7962

80-
// const result = await releaseChangelog({
81-
// versionData: projectsVersionData,
82-
// version: workspaceVersion,
83-
// verbose: true,
84-
// gitCommit: false,
85-
// stageChanges: false,
86-
// })
87-
8863
// npm publish with OIDC
8964
// not strictly necessary to restore the header but do it incase we require it later
9065
execSync(`git config --local http.https://github.com/.extraheader "${originalAuth}"`)
9166
// restore the GH token
9267
process.env.GITHUB_TOKEN = gh_token_bak
9368

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-
11169
// ---- Create release branch + PR ----
11270
// switch back to the releaser GitHub token
11371
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-
// }
12772

12873
const branchName = `release-test}`
12974

@@ -145,8 +90,6 @@ if (!validSpecifiers.includes(versionSpecifier) && !isValidVersion) {
14590
execSync(`git remote set-url origin "${remoteUrl}"`)
14691
}
14792

148-
console.log('Remote config before push:')
149-
console.log(execSync('git remote -v').toString())
15093
execSync(`git push origin ${branchName}`)
15194

15295
// Open PR using GitHub CLI
@@ -157,12 +100,7 @@ if (!validSpecifiers.includes(versionSpecifier) && !isValidVersion) {
157100

158101
// Enable auto-merge
159102
execSync(`gh pr merge --auto --squash`, { stdio: 'inherit' })
160-
161-
// execSync('git stash')
162-
// console.log('✅ Stashed package.json changes')
163103
} catch (err) {
164104
console.error('❌ Failed to push release branch or open PR', err)
165105
}
166-
167-
// process.exit(Object.values(publishResult).every((r) => r.code === 0) ? 0 : 1)
168106
})()

0 commit comments

Comments
 (0)